简体   繁体   中英

how to shift names of pandas list on python

So what i tried to is to import a csv file using pandas but i did not get exactly what i want here is the code:

cords = ["x1" , "y1" , .... , "x68" , "y68" ]
frame = pd.read_csv("hello.csv" , names = ["session" ] + cords , sep = ';')
frame

and here is a picture of the result, shifted data

NOTE: please click on Shifted Data to see the picture

well i want the 2 column to be the session and we can see that the y68 has literally nothing if we just shift the names one step to left everything would be great? Can you please help me ?

Thank you and have a nice day !

well using frame.columns after reading instead of names in the reading would solve the problem

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM