I have a list of tuples where each tuple contains a pair of coordinates. I would like to reverse the coordinates for each point.
I have a dataframe, and a specific column called "coord" contains a list of latitude and longitude coordinate pairs at each row, and I would like to reverse the pair of coordinates of each row.
As an example, the first row looks like this
[(52.34725, 4.91790),
(52.34715, 4.91797),
(52.34742, 4.91723),
(52.34752, 4.91713)]
I tried this function, but it does not work.
result = [[p[1], p[0]] for p in x]
The expected output is:
[(4.91790, 52.34725),
(4.91797, 52.34715),
(4.91723, 52.34742),
(4.91713, 52.34752)]