My problem is the following, I want to sum up all values of the column new_results_reported
, which have the Overall_Outcome
'Positive' and belong to the state Alabama
.
Filter out all columns that have the state_name
Alabama, have an overall_outcome
'Positive' and display the sum of them in the column new_results_reported
.
state_name object
overall_outcome object
date object
new_results_reported int64
total_results_reported int64
dtype: object
output of new_results_reported
from state Alabama
should be in Integer
I did some research and came up with something like:
for overall_outcome in table1:
if overall_outcome != 'Positive':
Unfortunately, I have absolutely no idea how to set up functions or how to do it best.
I would appreciate your help very much.