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<SPAN class="punctuation token">:</SPAN> Could <SPAN class="operator token">not</SPAN> load the dataset<SPAN class="punctuation token">:</SPAN> dtype <SPAN class="string token">'<class '</SPAN>datetime<SPAN class="punctuation token">.</SPAN>datetime<SPAN class="string token">'>'</SPAN> <SPAN class="operator token">not</SPAN> understood<SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
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:
<SPAN class="keyword token">from</SPAN> arcgis <SPAN class="keyword token">import</SPAN> GIS
gis <SPAN class="operator token">=</SPAN> GIS<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"https://arcgis.com"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="operator token">**</SPAN><SPAN class="operator token">*</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="operator token">**</SPAN><SPAN class="operator token">*</SPAN><SPAN class="punctuation token">)</SPAN>
item <SPAN class="operator token">=</SPAN> gis<SPAN class="punctuation token">.</SPAN>content<SPAN class="punctuation token">.</SPAN>get<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'The item id'</SPAN><SPAN class="punctuation token">)</SPAN>
flayer <SPAN class="operator token">=</SPAN> item<SPAN class="punctuation token">.</SPAN>layers<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="comment token"># create a Spatially Enabled DataFrame object</SPAN>
sdf <SPAN class="operator token">=</SPAN> pd<SPAN class="punctuation token">.</SPAN>DataFrame<SPAN class="punctuation token">.</SPAN>spatial<SPAN class="punctuation token">.</SPAN>from_layer<SPAN class="punctuation token">(</SPAN>flayer<SPAN class="punctuation token">)</SPAN>
sdf<SPAN class="punctuation token">.</SPAN>head<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Any ideas? Has anyone else run into this problem?