I am trying to join a csv-attribute table to a shapefile based on a variable ("pct16").
This is my code:
path_shp = cd + "ArcGIS/" path_data = cd + "data/2016/raw/" arcpy.JoinField_management(path_shp + "voting_precincts.shp", "pct16", path_data + "all_precinct_results.csv", "pct16")
When I run it, I get the following error:
ERROR 000339: Input C:/.../raw/all_precinct_results.csv does not have OIDs
The ESRI help advices to add an OID column to the table. My question is, how do I do that in ArcPy? Or, are there any quicker alternatives for my purpose?
A question that seems to be related is Working around Table does not contain OIDs arcpy Error 000339?. Maybe, it contains useful information to solve my problem but I was not able to judge for myself because I did not understand the question.