Last active
September 5, 2018 14:37
-
-
Save fcunhaneto/ecd7b8f3a4da8b8cd80489f1599b3d90 to your computer and use it in GitHub Desktop.
Criando um histograma para com os pesos dos alunos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import matplotlib.pyplot as plt | |
| from pandasUteis.pandas_utils import frequency_by_natural_order, frequency_by_buckets | |
| df = pd.read_csv('/home/francisco/Projects/Pycharm/' | |
| 'matplot-pandas-tutorial/files/questionario.csv') | |
| """ | |
| Criando um histograma para com os pesos dos alunos | |
| """ | |
| peso = df['Peso'] | |
| plt.figure(figsize=(8, 6)) | |
| plt.hist(peso, bins=range(40, 110,10)) | |
| plt.title('Distribuição de Pesos') | |
| plt.xlabel('Peso') | |
| plt.ylabel('Alunos') | |
| plt.savefig('imagens/peso-histograma.png') | |
| plt.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment