MoDown80

Joining a shapefiles attributes to a table in ArcGIS 10 using Python

Discussion created by MoDown80 on Mar 13, 2014
Latest reply on Feb 22, 2016 by Dan_Patterson
Hi Experts,

I am trying to join a shapefiles attributes to a table in ArcGIS 10 using Python.
This is the code I have been using. What do the errors mean?? Why are error occuring?

>>> import arcpy
>>> from arcpy import env
>>> env.workspace = "R:\Dawson, Monique\Canada_Weather_Grid"

Parsing error <type 'exceptions.SyntaxError'>: invalid syntax (line 2)
>>> arcpy.JoinField_management("nodes_gp_100.csv", "ID", "Alberta_Weather_Nodes", "ID")
...
Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 000339: Input nodes_gp_100.csv does not have OIDs Failed to execute (JoinField).
>>> arcpy.JoinField_management("Alberta_Weather_Nodes", "ID", "nodes_gp_100.csv", "ID")
Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 999999: Error executing function. Failed to execute (JoinField).
>>> arcpy.JoinField_management("GP_100", "ID", "Alberta_Weather_Nodes", "ID")

Outcomes