I'm trying to built a list of lists in the following format:
coordinates = [[38.768, -9.09], [[41.3092, -6.2762],[42.3092, -6.3762], [41.4092, -6.3762] ...]]
I have 2 lists of strings with the values of latitude and longitude which i want to combine (they are symmetric):
latitude = ['38.768004','41.3092,41.3059,41.3025']
longitude = ['-9.096851','-6.2762,-6.2285,-6.1809]
I'm using multiple loops trying to build my data and at this point i'm not very confident. I believe there's a better way. How would you do this? Thank you!
The multiple loops i was trying to test are not not valid but here it goes:
latitude = []
longitude = []
processes = dict
for lat in data['latitude']:
latitude.append(lat.split(','))
for lon in data['longitude']:
longitude.append(lon.split(','))
print(latitude)
coordinates = []
for i in range(len(latitude)):
# print("Coordinate number: %d" % i)
for x in range(len(latitude[i])):
processes[i] = processes[i] + 'teste'
# years_dict[line[0]].append(line[1])