My ultimate goal is this:
Step 1 works fine.
df = pd.read_csv("/arcgis/home/Chicago Homicide csv.csv")
#specifically changes a column to date and time
df['Date'] = pd.to_datetime(df['Date'])
#df.dtypes
df.head()
Step 2 also works fine
#makes a sdf and specifies the xy coord columns
sdf = GeoAccessor.from_xy(df,'Longitude','Latitude')
#df.dtypes
sdf.head()
sdf.spatial.plot()
This is the third and failing step
sdf.spatial.to_featureLayer('sdf_to_featureLayer')
#this is the resulting error
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/tmp/ipykernel_393/3728460398.py in <module>
----> 1 sdf.spatial.to_featureLayer('spf_to_featureLayer')
AttributeError: 'GeoAccessor' object has no attribute 'to_featureLayer'
I've been up and down forums in search of a solution, I actually used the answers from this post (ESRI community link) to get to where I am.
Any thoughts are much appreciated!
Hi @MicahJohns I don't see the import statements in your example above, so not sure how it was defined. can you try adding:
from arcgis.features import GeoAccessor