import pandas as pd
# create a sample dataframe
data = {'Cat': ['A', 'A', 'B', 'B', 'B', 'C'],
'Value': [10, 20, 30, 40, 50, 60]}
df = pd.DataFrame(data)
# compute the mean of each category
mean_df = df.groupby('Cat').agg({'Value':
'mean'}).reset_index().rename(columns={'Value':
'Mean'})
print(mean_df)