Skip to content
Advertisement

Converting a list of coordinates to point geometry

My geopandas df looks like this:

JavaScript

As you can see, the geometry column is a list containing longitude and latitude values. Is there an efficient way to convert them to points?

This works but is very inefficient:

JavaScript

When I put this in a loop I get TypeError: len() of unsized object

JavaScript

Basically I need the inverse of this question.

Reproducible data here:

JavaScript

Advertisement

Answer

I don’t know why you want a loop.

JavaScript

All coordinates have been changed to points.
Do you think this is really inefficient?


Update

sorry, I have a mistake. I think the solution you want is this.

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement