Column Total
df is a table of whole numbers and col is the name of one of its columns. Return the sum of that column as an int.
Example 1
df {"a":[1,2,3],"b":[10,20,30]}
col "b"
returns 60
The b column adds up to 60.
Constraints
colis a column ofdf- The table has at least one row
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More pandas problems
- Correlation of ColumnsBeginner
- Count Missing ValuesBeginner
- Count Repeated RowsBeginner
- Count Unique CitiesBeginner
- Count in RangeBeginner
- Drop Duplicate PairsBeginner
- Drop a ColumnBeginner
- Everyone ElseBeginner