While creating a defaultdict(list) containing street names, x and y coordinates, my x and y entries are converted to strings. This prevents me from doing calculations on them. I've been looking around but can't find a quick fix.
Here's my code and the snippet of the data when I print it out :
import arcpy import collections import pandas as pd import numpy as np import statistics from scipy.spatial import * #Environments arcpy.env.workspace = r'C:\Users\Contractuel\Documents\Etape_3' #Local variables fc = arcpy.env.workspace + '\SpatialJoin_Candiac.shp' fields = ['NOMRTE','X','Y'] d = collections.defaultdict(list) with arcpy.da.SearchCursor(fc, fields) as cursor : for roadname,x,y in cursor: d[roadname].append([x,y])
Rang Saint-Andre: [['617035,993369637', '5024323,46115644'], ['616978,930218717', '5024342,95813809'], ['616935,739846513', '5024366,96582001'], ['616898,918096905', '5024394,63637209'], ['616866,027555116', '5024438,9422574'], ['616845,464712524', '5024486,52105514']]
Anybody has ever encountered this problem?