I have a pandas dataframe df
with geographical coordinates like this:
lat lon
0 48.01025772 -6.15690851
1 48.02164841 -6.10588741
2 48.03302765 -6.05480051
... ... ...
I need to convert these coordinates into a different system, and have a dedicated function for this. I plan to create two new columns, df['N']
which is paired with lat
, and df['E']
which is paired with lon
.
It's not relevant what the function looks like, so for simplicity let's call it f. The function operates like this: E, N = f(float(lat), float(lon))
Is there a way I can iterate through all rows of df
, extract the lat,lon
pair, (compute their transformation) and assign the values to the relevant columns?