i have few polygons and distance of some points from those polygons. i tried to write in a csv by pandas where distance between each point and polygon will come in separate rows. i got this:
poly total inside outside dist
1000 2 0 2 [16015,5678]
1100 1 0 1 [5267]
I wanted to get like:
poly total inside outside dist
1000 2 0 2 16015
1000 2 0 2 5678
1100 1 0 1 5267
I tried the following after looking at this previous q [How to write nth value of list into csv file
distance =[]
for row in arcpy.da.SearchCursor(outSide, ["SHAPE@XY"]):
px, py = row[0]
zipPoint=point(px,py)
Distance.append(int(zipPoint.calDist(PolyCenter)))
for i in distance:
df.loc[polygon,"distance"]=distance
df.loc[zipCode,"Total"]=count
df.loc[zipCode,"Inside"]=insideNum
df.loc[zipCode,"Outside"]=outsideNum
But its giving me the same result in csv. any help is appreciated.