I\'d like to create a matplotlib pie chart which has the value of each wedge written on top of the wedge.
The documentation suggests I should use autopct
Using lambda and format may be better
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
path = r"C:\Users\byqpz\Desktop\DATA\raw\tips.csv"
df = pd.read_csv(path, engine='python', encoding='utf_8_sig')
days = df.groupby('day').size()
sns.set()
days.plot(kind='pie', title='Number of parties on different days', figsize=[8,8],
autopct=lambda p: '{:.2f}%({:.0f})'.format(p,(p/100)*days.sum()))
plt.show()