import_data Documentation or Code Bug

510
3
01-15-2018 09:20 AM
JoshuaBixby
MVP Esteemed Contributor

This question is directed at the ArcGIS API for Python staff participating in GeoNet.

I am trying to determine whether there is a software or code bug withimport data - arcgis.gis module — arcgis 1.3.0 documentation. According to the documentation,import_dataworks with a Pandas dataframe and can load a Pandas dataframe spatially ifaddress_fieldsare present.

While helping troubleshootUnboundLocalError: local variable 'fc_layer_definition' referenced before assignment, I came to find that including "x" and "y" fields in a Pandas dataframe is supported, and that points will be automatically created without adding any additional arguments. Attempting to generate a spatial dataframe similarly,spf = arcgis.features.SpatialDataFrame.from_df(df), generates an error and says no address fields are present.

那么,import_datasupposed to support adding Pandas dataframes with "x" and "y" columns or not? If yes, where is that documented?

0Kudos
3 Replies
DanPatterson_Retired
MVP Esteemed Contributor
0Kudos
一个ndrewChapkowski
金宝搏吧

Can you please add an example CSV that you are trying to use?

一个lso, can you post your code as well?

Thanks

0Kudos
JoshuaBixby
MVP Esteemed Contributor

I took the screenshot of data from//www.gobook3.com/thread/207898-unboundlocalerror-local-variable-fclayerdefinition-referenc...and uploaded it as a CSV after renaming long,lat columns to x,y.

0Kudos