df[df['month']==12]['cases'].plot() why in the beginning two dfs are there ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

df[df['month']==12]['cases'].plot() why in the beginning two dfs are there ?

Matplotlib

12th Dec 2021, 8:19 AM
Suraj kumar
Suraj kumar - avatar
4 Answers
+ 2
Suraj kumar Outer df is for cases Inner df is for month BTW df is only one but month and cases are row and columns df means dataframe which gives you data in matrix format. Print df you will get data in matrix format First we get month using df['month'] so if it is 12 then we get cases of that month.
12th Dec 2021, 8:48 AM
A͢J
A͢J - avatar
+ 2
Suraj kumar One to compare month and another to get data of cases on the comparison of month.
12th Dec 2021, 8:42 AM
A͢J
A͢J - avatar
+ 1
Okk Thank you
12th Dec 2021, 8:50 AM
Suraj kumar
Suraj kumar - avatar
0
Which df is for cases ?
12th Dec 2021, 8:43 AM
Suraj kumar
Suraj kumar - avatar