Okay, thank you both! Managed this.
The next problem is that X and Y coordinates are into, I guess, nested list?
How to make those XY coordinates as variables again?
For excel table that would be easy:
path = r"G:\FOLDER\TEST_excel.xls"
df = pd.read_excel(path)
for i in range(0,len(df)):
lat3 = df['lat'][i]
lon3 = df['lon'][i]
distance = haversine(lat, lon, lat2, lon2)
dist.append(distance)
In list those XY values look's something like this [(11111111.1111, 22222222.2222) , (44444.4242, 818182388.1239), (etc...)]
pole_xy = []
dist = []
def haversine(lon1, lat1, lon2, lat2):
etc...
shp = os.path.join(path,r"C:\Users\name\Documents\GIS\PRJ\TEST\DB.sde\DB.NetworkData\DB.FeatureClass")
with arcpy.da.SearchCursor(shp, "SHAPE@XY") as rows:
for row in rows:
pole_xy.append(row[0])
for i in range(0,len(pole_xy)):
lat3 = pole_xy['SHAPE@X']
lon3 = pole_xy['SHAPE@Y']
distance = haversine(lat, lon, lat3, lon3)
dist.append(distance)
how to get lat3 = all X values and into lon3 = all Y values?
Never stop learning