I\'m trying to build a GeoJSON object. My input is a csv with an address column, a lat column, and a lon column. I then created Shapely points out of the coordinates , buffe
I got to this post because I ran into a similar issue, but when running a PySpark DataFrame instead of Pandas.
In case someone ends up here, like myself, I'll explain how I fixed it for a PySpark DataFrame.
The reason why I was getting the error (built-in method of Row object
, in my case), was because my field name count
was colliding with the inherited method count from python tuples (as seen here).
The solution was simply change the name of the field to something like my_count
and it worked fine.
Thanks, DSM, for pointing that out. Lesson learned: pandas is not good for arbitrary Python objects
So this is what I wound up doing:
temp = zip(list(data.geom), list(data.address))
output = map(lambda x: {'geometry': x[0], 'properties':{'address':x[1]}}, temp)