Skip to content

Instantly share code, notes, and snippets.

@fcunhaneto
Last active September 5, 2018 14:37
Show Gist options
  • Select an option

  • Save fcunhaneto/ecd7b8f3a4da8b8cd80489f1599b3d90 to your computer and use it in GitHub Desktop.

Select an option

Save fcunhaneto/ecd7b8f3a4da8b8cd80489f1599b3d90 to your computer and use it in GitHub Desktop.
Criando um histograma para com os pesos dos alunos
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