AnsweredAssumed Answered

ArcGIS API for Python Spatially Enabled Data Frame broken with datetime fields

Question asked by Ben.Sperry_oxitec on Feb 12, 2019
Latest reply on May 5, 2020 by r3weber

I am trying to create a Spatially Enabled Data Frame object from a FeatureLayer object using the ArcGIS API for python version 1.5.3 and pandas version 0.24.1. When I use web layers that don't have date fields it works fine, but as soon as it has a date field it stops working and I get the following error:


Exception: Could not load the dataset: dtype '<class 'datetime.datetime'>' not understood


I copied the code directly from the Introduction to the Spatially Enabled Data Frame guide page and just substituted the item id for one of my own web layers. Here is my code:


from arcgis import GIS
gis = GIS("", ***, ***)
item = gis.content.get('The item id')
flayer = item.layers[0]

# create a Spatially Enabled DataFrame object
sdf = pd.DataFrame.spatial.from_layer(flayer)

Any ideas? Has anyone else run into this problem?