I have below data frame, on which am creating a chart:
The expectation is to create as below which is in Excel:
But while defining the axis in matplotlib, am facing an issue,
import matplotlib.pyplot as plt
import pandas as pd
import random
def la_bar():
df1 = pd.DataFrame(lst, columns=['source','type','date','count']) #lst is a data set
ax = df.plot(x="date", y="count", kind="bar")
df.plot(x="date", y="source", kind="bar", ax=ax)
plt.savefig("static/images/image.png")
la_bar()
am getting key error as below,
raise KeyError(key)
KeyError: 'date'
What can I try to resolve this?