I am trying to convert the first column row of dataframe to add into a first row and will shift all the other rows to the bottom without losing a last row.
import numpy as np
import pandas as pd
df = pd.DataFrame(np.random.randint(0,3,size=(3, 4)), columns=list('1234'))
df
dataframe output
1 2 3 4
0 1 1 0 1
1 2 1 1 1
2 0 0 1 2
expected output
A B C D
0 1 2 3 4
1 1 1 0 1
2 2 1 1 1
3 0 0 1 2
what I tried so far
df.columns.values[0:4] =["A", "B", "C", "D"]
current output
A B C D
0 1 1 0 1
1 2 1 1 1
2 0 0 1 2
I just lost the last row but I want to add column row into the first row and then add column headers