![]() |
Pandas Shift Column - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Data Science (https://python-forum.io/forum-44.html) +--- Thread: Pandas Shift Column (/thread-8790.html) |
Pandas Shift Column - shaq - Mar-08-2018 Hi guys, I'm new to Pandas and after 2 days of desperate trying I would like to ask for your help. I have an output by a program in a txt file with a variable number of colums which I loaded into a Data frame. Unfortunately it looks like this and I need to change the layout using Pandas: [Image: 32031061wr.jpg] I would like to shift all colums, which contain a non numeric value in row 0 + delete the first row afterwards + delete all columns containing *** The result should look like this [Image: 32031062ts.png] I suppose I need to use the functions .isnumeric() or some kind of regex contains."[a-zA-Z]" to identify the columns that need to be shifted. Thank you for your help! |