I've got a dataframe like below with 66,000 rows..
Client | Nodes |
---|---|
Client A | [987673, 932132, 3132131, 3123443, ...] |
Client B | [4324234, 56345, 5435345, 5345345, ...] |
What I need to do is run the below function on the list within each row and then put the result in a new column.
I've tried using the .apply function but not sure how to loop it through the list
RouteNodeLL = []
for node in route_nodes:
response_xml = requests.get(f'https://api.openstreetmap.org/api/0.6/node/{node}')
response_xml_as_string = response_xml.content
responseXml = ET.fromstring(response_xml_as_string)
for child in responseXml.iter('node'):
RouteNodeLL.append((float(child.attrib['lat']), float(child.attrib['lon'])))