Get the Sum of All Columns in a pandas DataFrame

If you want to take the sum of all columns, use sum(axis=1). If you want to take the sum of all rows, use sum(axis=0).

My previous tips on pandas.

Scroll to Top