Pandas apply to dateframe produces '<built-in method values of …'

后端 未结 2 1003
被撕碎了的回忆
被撕碎了的回忆 2021-01-11 21:52

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

2条回答
  •  一个人的身影
    2021-01-11 22:48

    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)
    

提交回复
热议问题