Создание кадра данных в GeoPandas дает «TypeError super (type, obj): obj должен быть экземпляром или подтипом типа» - PullRequest
0 голосов
/ 01 июня 2019

TypeError: super(type, obj): obj must be an instance or subtype of type при создании 1 столбца для точек из 2 столбцов широты и длины

Не могли бы вы помочь мне с этим?

У меня есть набор данных как customer_lat, customer_lng Я хочу создать 1 столбец в виде точки из долгого лат

from shapely.geometry import Polygon
from shapely.geometry import Point
import pandas as pd
import geopandas as gpd
df=pd.read_csv("C:\\Users\\n.nguyen.2\\Documents\\order from May 1.csv")

geometry=[Point(xy) for xy in zip(df['customer_lat'],df['customer_lng'])]
crs={'init':'epsg:4326'}
gdf=gpd.GeoDataFrame(df,crs=crs,geometry=geometry)
gdf.head()
Traceback (most recent call last):

  File "<ipython-input-82-1f38d31ae996>", line 9, in <module>
    gdf=gpd.GeoDataFrame(df,crs=crs,geometry=geometry)

  File "C:\Users\n.nguyen.2\AppData\Local\Continuum\anaconda3\lib\site-packages\geopandas\geodataframe.py", line 47, in __init__
    super(GeoDataFrame, self).__init__(*args, **kwargs)

TypeError: super(type, obj): obj must be an instance or subtype of type
...