Код: Выделить всё
SeniorCitizen Partner Dependent
Yes Yes No
No Yes No
No No Yes
Yes No No
Код: Выделить всё
ax1 = df2['SeniorCitizen'].value_counts().plot(kind='pie', figsize=(5,5), fontsize=10,
labels = ['No', 'Yes'], autopct='%1.0f%%')
ax1.set_title('% of Senior Citizens', fontsize = 12)
plt.show()
ax2 = df2['Partner'].value_counts().plot(kind='pie', figsize=(5,5), fontsize=10, autopct='%1.0f%%')
ax2.set_title('% of People with and without partner', fontsize = 12)
plt.show()
ax2 = df2['Dependents'].value_counts().plot(kind='pie', figsize=(5,5), fontsize=10, autopct='%1.0f%%')
ax2.set_title('% of People with and without dependent', fontsize = 12)
plt.show()
Может ли кто-нибудь помочь с объяснением и кодом?
Что-то вроде этого:

Подробнее здесь: https://stackoverflow.com/questions/657 ... gle-figure