NameError: OLD_PANDAS Spatial Data Fram from FeatureLayer

4422
14
Jump to solution
02-11-2019 10:58 AM
BenjaminSperry1
Occasional Contributor

Hello,

I am trying to convert a FeatureLayer object into a SpatialDataFrame object but am running into a strange error:

NameError: name 'OLD_PANDAS' is not defined

Any ideas what is wrong or how I can fix this?

I have imported the requisite packages I believe;

Many thanks

14 Replies
DavidWasserman
Occasional Contributor III

That makes sense. Generally, I would recommend sticking to one or the other. It can be really difficult to get them to play nice. 

David Wasserman, AICP
0 Kudos
by Anonymous User
Not applicable

Try downgrading to pandas version "0.23.4" (I'm not sure on the exact version where it breaks, but this worked for me). There was a change in a pandas module that the ArcGIS API for Python is not accounting for yet.

TeodoraEnache
New Contributor

I had the exact same problem with the data frame conversion and downgrading to pandas 0.23.4 worked! Thank you.

0 Kudos
JillKelly
New Contributor III

I downgraded to 0.23.4, but it did not solve the problem.  pandas.DataFrame.spatial does not seem to have a method .from_layer, at least not according to tab-complete.  (using arcgis 1.6)

0 Kudos
DanPatterson_Retired
MVP Emeritus

for ArcGIS Pro 2.3.1 installed today, ArcGIS and pandas are listed below

(arcgispro-py3) C:\arc_pro\bin\Python\envs\arcgispro-py3>conda list
# packages in environment at C:\arc_pro\bin\Python\envs\arcgispro-py3:
#
...
arcgis                    1.5.3            py36h66efe7d_1    esri
arcgispro                 2.3                  h35c310c_0    esri
...
pandas                    0.24.1           py36ha925a31_

0 Kudos