-3

I have two separate lists, one that displays the latitude and one that displays the longitude of several sites that go together to make coordinates.

site_lat = df['SITE_LAT'].values
site_lon = df['SITE_LON'].values

print(site_lat)
print(site_lon)

Out:

[-43.38819    -43.49636    -43.38115    -43.37939    -43.5033
 -43.56368    -43.554      -43.57971    -43.5298     -43.57286
 -43.5305     -43.509      -43.5014     -43.5102     -43.49739
 -43.38137    -43.3816     -43.52867    -43.50848    -43.38075
 -43.38053    -43.5052     -43.38295    -43.37932    -43.52772
 -43.52822    -43.49919    -43.52377    -43.39104    -43.49811
 -43.52506    -43.5244     -43.485115   -43.380177   -43.386207
 -43.582139   -43.528555   -43.573772   -43.562665   -43.457495
 -43.480346   -43.392772   -43.381836   -43.380637   -43.590068
 -43.47111    -43.582984   -43.514007   -43.486072   -43.475549
 -43.524372   -43.581061   -43.47893333 -43.509864   -43.529607  ]
[172.66213   172.70281   172.6736    172.64842   172.66232   172.60192
 172.61773   172.54881   172.60366   172.60804   172.6016    172.6836
 172.6857    172.7215    172.70474   172.66143   172.65777   172.64241
 172.68695   172.65704   172.66875   172.66001   172.6591    172.65357
 172.63697   172.63646   172.70525   172.61232   172.66066   172.70027
 172.642     172.633     172.712223  172.647993  172.668404  172.536411
 172.685047  172.548991  172.555511  172.61905   172.582113  172.659937
 172.659306  172.670703  172.568637  172.613926  172.516276  172.588811
 172.685501  172.706847  172.672883  172.57687   172.7105194 172.570035
 172.592257 ]

how would I go about combining these to make a list that prints them as coordinates?

Patrick Artner
  • 50,409
  • 9
  • 43
  • 69

1 Answers1

0

Given both initial list are of same size, you can use zip() to merge both site_lat and site_lon which will return a list of latitudes and longitudes.

coordinates = list(zip(site_lat, site_lon))
testrDev
  • 17
  • 8