Matplotlib is library which is used in data visualization.
Code for Creating Pie Chart using matplotlib:
For creating pie chart import matplotlib as shown below
import matplotlib.pyplot as plt fig = plt.figure(figsize =(100, 7)) mylabels=['x','y','z'] values=[159,147,89] # autopct is used for reflecting percentage plt.pie(values,labels=mylabels,autopct=lambda x: '{:.2f}%({:.0f})'.format(x,(x/100)*sum(values))) plt.show()
Output will be pie chart shown below
labels and values can be mapped from pandas dataframe.