[英]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我有covid-19的数据集,我已经使用for循环遍历所有州并划分总死亡人数和总病例数,我使用append来存储结果,它显示我想要的结果是打印每个state旁边价值
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.我同意 Reza Rahemtola 的观点,请不要上传代码截图,而是将其作为文本提供。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.