row based mean pandas dataframe code example Example: return mean of dataframe as single row dataframe df.mean().to_frame().T