0

I want to convert longitude deg, min, sec and latitude deg, min, sec to another form from the original data frame, but in order to do it I need to shift the data from those columns into the right place.

Here is my data frame:

original data frame

The data in random columns are not in the right place, so can anyone tell me which code to use when shifting the data to the right place. Some need to shift 2 to the right, some need to shift 2 to the right. I tried this code, but it just shifted the whole row and not in the place I want. And when I load and print this csv file, it shows like in the picture, how does it mean by having " \t" between the values. here is what I've tried:

import numpy as np
import pandas as pd
GPS = pd.read_csv("fairfield_loc.csv", encoding = "ISO-8859-1")
print(GPS.head(2))
GPS.loc[1]= GPS.loc[1].shift(1)
print(GPS.head(2)) 

This is the output: Output Thank you!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Refrain from showing your dataframe as an image. Your question needs a minimal reproducible example consisting of sample input, expected output, actual output, and only the relevant code necessary to reproduce the problem. See [How to make good reproducible pandas examples](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) for best practices related to Pandas questions. – itprorh66 Nov 17 '22 at 20:07

0 Answers0