I am using this dataset: https://opendataportal-lasvegas.opendata.arcgis.com/datasets/restaurant-inspections-open-data/explore
In this dataset, there is a feature 'Location_1'
which involves the coordinates of locations of restaurants:
Location_1
0 (36.12976350, -115.31507320)
1 (36.10882500, -115.32125900)
2 (36.07411000, -115.08284000)
3 (36.07411000, -115.08284000)
4 (36.12734880, -115.14185020)
I want to create two new columns in my DataFrame, one for latitude and one for longitude.
I naively tried to generate the column vectors first with the commands
lat = df['Location_1'][:,0]
long = df['Location_1'][:,1]
but it did not work. It looks like that the entries in df['Location_1']
are strings.
For instance, I tried
In [5]: df['Location_1'][1][1:30]
Out[5]: '36.10882500, -115.32125900)'
But I want to get floats in the latitude and longitude columns.