I am trying to extract the index of a pair of coordinates within a GeoJSON file.
Code:
coords = []
for school in data_set['features']:
points = school['geometry']['coordinates']
p1 = [point[0] for point in points]
coords.append(points)
print(coords)
Error message:
p1 = [point[0] for point in points]TypeError: 'float' object is not subscriptable.
When I run the code without defining p1 & p2 I receive the coordinates as floating points that are a nested list within a list. What do I have to do to make the object subscriptable? Also, what does subscriptable mean?
Thank you