Back
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 row with column-totals, you can refer the following code:
df.loc['Total']= df.sum()
If you want to learn more about Pandas then visit this Python Course designed by the industrial experts.
31k questions
32.8k answers
501 comments
693 users