I get the above mentioned error in this problem. Can anyone please help me correct it?
Example data frame: column ID
with 3 numbers and column count
with 3 numbers.
If key='count'
, the sum of the values in the count
value will be obtained. If key='ID'
, the sum of the values in the ID
column will be summed.
Current code:
def sum_column(X,key='count'):
S = X[key].sum()
return S