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).
sum(axis=1)
sum(axis=0)
My previous tips on pandas.
DuckDB: Simplify DataFrame Analysis with Serverless SQL
Simplifying Dataset Comparison with Datacompy
Fuzzy Joining Tables with Non-Exact Matching Entries
Your email address will not be published. Required fields are marked *
Name
Email
Website
Save my name, email, and website in this browser for the next time I comment.