I have the following DataFrame (df):
DataFrame
df
import numpy as np import pandas as pd df = pd.DataFrame(np.random.rand(10, 5))
How about using "T"?
df.T.reindex(['mean',0,1,2,3,4]).T