I have a series of geographic coordinates as below and am fairly new to Series. I need to extract the latitude and longitude from these coordinates into separate series to concatenate back into the dataframe. I have tried a few different methods w/o luck. Can someone please help me understand how best to do this?
Code I have tried:
printing type of this is a <list> but just returns the first record in the series
df['Location'].str.split(',')[0]
treat as string and try to extract the first list element and then the first of the tuple
longitude = df['Location'].str[0][0].replace('(', '')
The Location field is a series of lists of tuples.
0         [(34.0255,  -118.3002)]
1         [(34.0256,  -118.3089)]
2         [(34.0738,  -118.2078)]
3         [(34.0492,  -118.2391)]
4         [(34.0108,  -118.3182)]
                   ...
594800    [(34.0436,  -118.3053)]
594801    [(33.9572,  -118.3962)]
594802    [(34.1684,  -118.3982)]
594803    [(34.1976,  -118.3965)]
594804    [(34.0504,  -118.3442)]
 
     
     
    