Thank you very much for the response. I hadn't realized the change.
I am using the arcgis v 1.5.2
pandas v 0.24.0
I am not familiar with the spatially enabled data frame object but after following the guide I am getting the following error:
I tried it with several different feature layers including a very simple one with no dates and it always gives me the same error. Am I missing something?
Here is the full error message in case it helps:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\geo\_accessor.py in from_layer(layer)
1966 from arcgis.features.geo._io.serviceops import from_layer
-> 1967 return from_layer(layer=layer)
1968 except ImportError:
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\geo\_io\serviceops.py in from_layer(layer, query)
122 else:
--> 123 return layer.query(where=query, as_df=True)
124 return res
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\layer.py in query(self, where, out_fields, time_filter, geometry_filter, return_geometry, return_count_only, return_ids_only, return_distinct_values, return_extent_only, group_by_fields_for_statistics, statistic_filter, result_offset, result_record_count, object_ids, distance, units, max_allowable_offset, out_sr, geometry_precision, gdb_version, order_by_fields, out_statistics, return_z, return_m, multipatch_option, quantization_parameters, return_centroid, return_all_records, result_type, historic_moment, sql_format, return_true_curves, return_exceeded_limit_features, as_df, **kwargs)
709 import pandas as pd
--> 710 df = self._query_df(url, params)
711 dt_fields = [fld['name'] for fld in self.properties.fields \
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\layer.py in _query_df(self, url, params)
1452 df.loc[q, fld['name']] = 0
-> 1453 df = df.astype(dtypes, False)
1454 if 'geometryType' in featureset_dict:
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\pandas\core\generic.py in astype(self, dtype, copy, errors, **kwargs)
5667 if col_name in dtype:
-> 5668 results.append(col.astype(dtype[col_name], copy=copy))
5669 else:
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\pandas\core\generic.py in astype(self, dtype, copy, errors, **kwargs)
5680 new_data = self._data.astype(dtype=dtype, copy=copy, errors=errors,
-> 5681 **kwargs)
5682 return self._constructor(new_data).__finalize__(self)
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\pandas\core\internals\managers.py in astype(self, dtype, **kwargs)
530 def astype(self, dtype, **kwargs):
--> 531 return self.apply('astype', dtype=dtype, **kwargs)
532
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\pandas\core\internals\managers.py in apply(self, f, axes, filter, do_integrity_check, consolidate, **kwargs)
394
--> 395 applied = getattr(b, f)(**kwargs)
396 result_blocks = _extend_blocks(applied, result_blocks)
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\pandas\core\internals\blocks.py in astype(self, dtype, copy, errors, values, **kwargs)
533 return self._astype(dtype, copy=copy, errors=errors, values=values,
--> 534 **kwargs)
535
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\pandas\core\internals\blocks.py in _astype(self, dtype, copy, errors, values, **kwargs)
594
--> 595 dtype = pandas_dtype(dtype)
596
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\pandas\core\dtypes\common.py in pandas_dtype(dtype)
2028 elif npdtype.kind == 'O':
-> 2029 raise TypeError("dtype '{}' not understood".format(dtype))
2030
TypeError: dtype '<class 'datetime.datetime'>' not understood
During handling of the above exception, another exception occurred:
Exception Traceback (most recent call last)
<ipython-input-5-8e6be27d7403> in <module>
----> 1 spd = pd.DataFrame.spatial.from_layer(feature_layer)
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\geo\_accessor.py in from_layer(layer)
1971 raise Exception("Malformed response from server, could not load the dataset: %s" % str(je))
1972 except Exception as e:
-> 1973 raise Exception("Could not load the dataset: %s" % str(e))
1974
1975 @staticmethod
Exception: Could not load the dataset: dtype '<class 'datetime.datetime'>' not understood