Hi i have a dataframe like this:
import pandas as pd
df = pd.DataFrame({
'A': [1, 2, 3],
'B': ['1.1', '1.2','1.3'],
'C': [4.1, 5.2, 6.3]
})
print(df)
And i need to move the ‘c’ column under the ‘a’ column with a space in the middle
I tried with the shif function, but it will move only the data under the column and not the column too. The dataframe im working on is bigger, so i need to move like 7 columns and data under the first 2 columns. Is that possible?
New contributor
Andrea Evangelista is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.