UnboundLocalError: local variable 'fc_layer_definition' referenced before assignment

2981
10
Jump to solution
01-13-2018 03:27 PM
JasonCarter
New Contributor III

Hello,

I'm attempting to add a layer to a map in Jupyter Notebook but am receiving the error:

UnboundLocalError: local variable 'fc_layer_definition' referenced before assignment
‍

My code is as follows:

from arcgis.gis import *
import pandas as pd
gis = GIS()

df = pd.read_csv('file.csv')
df_layer = gis.content.import_data(df)
m = gis.map()
m.add_layer(df_layer)‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

My dataframe is as follows:

ID         ID2                     NAME                                CODE2          LONGITUDE_MEASURE   LATITUDE_MEASURE

22100519XXXX2100519-001-122.96000038.250000
32100519XXX2100519-002-122.95000038.250000
42100519XXXXX2100519-004-122.95771438.257917

I do not understand what variable is being referenced before the assignment. Thank you

Tags (2)
0 Kudos
10 Replies
by Anonymous User
Not applicable

Thanks for reporting, this bug should be fixed in the next release of the API.