I have a successful piece of python code that reads selected data from a csv and returns it in the following format....
Att_Dict = {'7643': '7625', '9644': '2289', '4406': '4443', '7588': '9681', '2252': '7947'}
That has been pointed out as the incorrect format for the data I am trying to update (data type long int) from the seq dictionary.Can anyone tell me how to have the data returned without the ' ' as below??....
Att_Dict = {7643: 7625, 9644: 2289, 4406: 4443, 7588: 9681, 2252: 7947}
My sledgehammer approach to date has been unsuccessful by simply removing ' ' from the Att_Dict.update line in my code and from researching on this forum, reading the Python https://docs.python.org/2/library/index.html, and geonet.esri.
This is my working code;
import arcpy, csv Att_Dict ={} with open ("C:/Data/Code/Python/Library/Peter/123.csv") as f: reader = csv.DictReader(f) for row in reader: if row['Status']=='Keep': Att_Dict.update({row['book_id']:row['book_ref']}) print Att_Dict(Using Win 7, ArcGIS 10.2, Python 2.7.5)
أكثر...
Att_Dict = {'7643': '7625', '9644': '2289', '4406': '4443', '7588': '9681', '2252': '7947'}
That has been pointed out as the incorrect format for the data I am trying to update (data type long int) from the seq dictionary.Can anyone tell me how to have the data returned without the ' ' as below??....
Att_Dict = {7643: 7625, 9644: 2289, 4406: 4443, 7588: 9681, 2252: 7947}
My sledgehammer approach to date has been unsuccessful by simply removing ' ' from the Att_Dict.update line in my code and from researching on this forum, reading the Python https://docs.python.org/2/library/index.html, and geonet.esri.
This is my working code;
import arcpy, csv Att_Dict ={} with open ("C:/Data/Code/Python/Library/Peter/123.csv") as f: reader = csv.DictReader(f) for row in reader: if row['Status']=='Keep': Att_Dict.update({row['book_id']:row['book_ref']}) print Att_Dict(Using Win 7, ArcGIS 10.2, Python 2.7.5)
أكثر...