4. Visualização das Notas
Nesta etapa, são apresentados histogramas e boxplots para visualizar a distribuição das notas dos estudantes.
import os
from IPython.display import Image, display
os.makedirs('imagens', exist_ok=True)
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.savefig('imagens/histograma_notas.png')
plt.show()
display(Image(filename='imagens/histograma_notas.png'))
plt.figure(figsize=(10, 6))
sns.boxplot(data=df[['math score', 'reading score', 'writing score']])
plt.title('Boxplot das Notas')
plt.savefig('imagens/boxplot_notas.png')
plt.show()
display(Image(filename='imagens/boxplot_notas.png'))