Python Forum

Full Version: Pandas Shift Column
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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!