When I was using
df['mean'] = df.mean(axis = 1)
, it always added an extra COLUMN of average of each rows. But now I need an extra ROW to get each COLUMNS' mean. So I switch to
df['mean'] = df.mean(axis = 0)
but it still has an extra column but with all NaN. How can I get the row of each columns' average?
Here's the example ↓