Вход:
df.groupby('Age Group').size()
Выход:
18 thru 24 352
25 thru 34 358
35 thru 44 341
45 thru 54 336
55 and Older 269
Under 18 103
dtype: int64
Вход:
age = df.loc[df['Age Group']== '18 thru 24'].count()[0]
labels = ['18 thru 24']
plt.pie(['18 thru 24'], labels = labels)
plt.show()
Выход:
ValueError: could not convert string to float: '18 thru 24'