简体   繁体   中英

I want to print each state next to its own value

I have dataset of covid-19 and I've used for loop to thro all states and divided total deaths & total cases and I use append to store the results and it's showing the result what I want is to print every state next to its own value

here is my code enter image description here

You can try something like the following:

s = []
for i in range(len(r)):
    value = r['tot_death'][i]/r['tot_cases'][i]
    s.append((value, r['state']))

And I agree with Reza Rahemtola, please dont upload screenshots of code, instead just give it as text.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM