I have the following problem:
I want to total up all the case numbers of each state in the following file and display them in a new table.
for example, in the file from each day in 2020/2021 there are the new positive corona cases from the state of alabama.
thanks to a user in stackflow, i have the number of all new cases in 2020 using the code :
total_sum2 = 0
for overall_outcome, dt, new_results_reported in zip(America2['overall_outcome'].values.tolist(),America2['date'].values.tolist(), America2['new_results_reported'].values.tolist()):
ndt = int(str(dt)[:4])
if (overall_outcome == 'Positive') and (ndt == 2020):
total_sum2 += int(new_results_reported)
print(total_sum2)
state_name object overall_outcome object date object new_results_reported int64 total_results_reported int64 dtype: object
can be determined.
How can I now automatically determine the numbers for each state and then compare them graphically and display them in a separate table?
I would be very grateful for your help