I am kind of stucked in a pretty simple task - at least what I thought.
Suppose you have a DataFrame with following shape (So the data frame is given)
df = pd.DataFrame({"col a": [0, 1, 2, 3, "name a"],
"col b": [0, 1, 2, 3, "name b"],
"col c": [0, 1, 2, 3, "name c"]})
col a col b col c
0 0 0 0
1 1 1 1
2 2 2 2
3 3 3 3
4 name a name b name c
If I use the following command
df.columns=df.iloc[4]
the original header disappears. Any suggestion how to achieve my goal. Of course if it would be one sheet I could do it manually, however I have multiple sheets and this need to automatize it
Any kind of support is really appreciated The result should be that way
name name name
0 0 0 0
1 1 1 1
2 2 2 2
3 3 3 3
4 col a col b col c