+2 votes
in Python by
From this covid-19 dataset:

How can you make a line plot indicating the confirmed cases with respect to date?

1 Answer

0 votes
by

maha = df[df.state == ‘Maharashtra’]

sns.set(rc={‘figure.figsize’:(15,10)})

sns.lineplot(x=”date”,y=”confirmed”,data=maha,color=”g”)

plt.show()

Code Explanation:

We start off by extracting all the records where the state is equal to “Maharashtra”:

maha = df[df.state == ‘Maharashtra’]

Then, we go ahead and make a line-plot using seaborn library:

sns.set(rc={‘figure.figsize’:(15,10)})

sns.lineplot(x=”date”,y=”confirmed”,data=maha,color=”g”)

plt.show()

Here, we map the “date” column onto the x-axis and “confirmed” column onto y-axis.

Related questions

0 votes
asked May 17, 2020 in Python by sharadyadav1986
0 votes
asked May 16, 2020 in Python by Robindeniel
...