I would like to plot the following data
>>> AllSummary
upload_date Gross Loan Amount NewPerfColumn
0 2018-02-19 1.532472e+11 2.624765e+08
1 2018-03-01 1.475863e+11 1.361267e+08
2 2018-03-12 1.376221e+11 1.133450e+08
As shown below, the column "upload_date" is definitely recognized as a date
AllSummary.dtypes
upload_date datetime64[ns]
Gross Loan Amount float64
NewPerfColumn float64
dtype: object
but when i plot the data it shows x-xis as a number (not as date): the code is below
x=AllSummary['upload_date']
y1 =AllSummary['Gross Loan Amount']
y2 =AllSummary['NewPerfColumn']
fig, ax1 = plt.subplots()
ax2 = ax1.twinx()
ax1.plot(x, y1, 'g-')
ax2.plot(x, y2, 'b-')
ax1.set_xlabel('Date')
ax1.set_ylabel('Gross Loan Amount', color='g')
ax2.set_ylabel('Performance', color='b')
plt.show()
why is it the case?