0

TypeError: super(type, obj): obj must be an instance or subtype of type when creating 1 column for points from 2 columns lat and long

Could you please help me with this?

I have a data set as customer_lat, customer_lng I want to create 1 column as a point from lat long

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
Georgy
  • 12,464
  • 7
  • 65
  • 73
  • I assume you have resolved it? (based on your next questionhttps://stackoverflow.com/questions/56413817/define-points-within-a-polygon). Can you share what was the issue? – martinfleis Jun 02 '19 at 19:41
  • Hi, it does not work in Spyder but it works in Jupyter Notebook. – Ngoc Nguyen Jun 02 '19 at 22:34

0 Answers0