I have a DataFrame with numerical values. What is the simplest way of appending a row (with a given index value) that represents the sum of each column?
To add a Total column which is the sum across the row:
Total
df['Total'] = df.sum(axis=1)
2.1m questions
2.1m answers
60 comments
56.9k users