I want to plot a graph for Covid-19 in India and so far there's no problem when I manually input my data as x and y axis. But since the data is quite long and when I want to read it as .csv file, it gives me this error 'value' must be an instance of str or bytes, not a float. I have also try to wrap int(corona_case), but giving me another new error, cannot convert the series to <class 'int'. Also I would be very appreciate if someone can suggest me tutorials on plotting graph involving datetime using python since this is my first time learning python. I am using Python 3.
p/s I seem can't find a way to share my csv file so I am gonna leave it in snippet.
import pandas as pd
from datetime import datetime, timedelta
from matplotlib import pyplot as plt
from matplotlib import dates as mpl_dates
import numpy as np
plt.style.use('seaborn')
data = pd.read_csv('india.csv')
corona_date = data['Date']
corona_case = data['Case']
plt.plot_date (corona_date, corona_case, linestyle='solid')
plt.gcf().autofmt_xdate()
plt.title('COVID-19 in India')
plt.xlabel('Date')
plt.ylabel('Cumulative Case')
plt.tight_layout()
plt.show()
Date,Case
2020-09-30,6225763
2020-10-01,6312584
2020-10-02,6394068
2020-10-03,6473544
2020-10-04,6549373
2020-10-05,6623815
2020-10-06,6685082