4. Visualização das Notas
Nesta etapa, são apresentados histogramas e boxplots para visualizar a distribuição das notas dos estudantes.
# Histogramas das notas
fig, axes = plt.subplots(1, 3, figsize=(18, 5))
for idx, col in enumerate(['math score', 'reading score', 'writing score']):
sns.histplot(df[col], bins=20, ax=axes[idx], kde=True)
axes[idx].set_title(f'Distribuição: {col}')
plt.tight_layout()
plt.show()
plt.close(fig)
# Boxplot das notas
fig2, ax2 = plt.subplots(figsize=(10, 6))
sns.boxplot(data=df[['math score', 'reading score', 'writing score']], ax=ax2)
ax2.set_title('Boxplot das Notas')
plt.tight_layout()
plt.show()
plt.close(fig2)