<jupyter_start><jupyter_text>Histograms<jupyter_code>import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
plt.style.use('fivethirtyeight')
ages = [18, 19, 21, 25, 26, 26, 30, 32, 38, 45, 55]
groups = np.arange(10, 70, 10)
plt.hist(ages, bins=groups, edgecolor='black')
plt.title('Ages of Respondents')
plt.xlabel('Ages')
plt.ylabel('Total Respondents')
plt.show()
data = pd.read_csv('data/data_hist.csv')
data.head()
ids = data['Responder_id']
ages = data['Age']
data.shape
plt.hist(ages, bins=groups, edgecolor='black')
plt.title('Ages of Respondents')
plt.xlabel('Ages')
plt.ylabel('Total Respondents')
plt.show()
groups = np.arange(10, 101, 10)

plt.hist(ages, bins=groups, edgecolor='black', log=True)
plt.title('Ages of Respondents')
plt.xlabel('Ages')
plt.ylabel('Total Respondents')
plt.show()
median_age = 29
color = '#fc4f30'

plt.axvline(median_age, color=color, label='Age Median', linewidth=2)
plt.hist(ages, bins=groups, edgecolor='black', log=True)
plt.title('Ages of Respondents')
plt.xlabel('Ages')
plt.ylabel('Total Respondents')
plt.show()
median_age = 29
color = '#fc4f30'

plt.axvline(median_age, color=color, label='Age Median',
            linewidth=1)

plt.hist(ages, bins=groups, edgecolor='black', log=True)


plt.title('Ages of Respondents')
plt.xlabel('Ages')
plt.ylabel('Total Respondents')


plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17052023121387283, 'fraction_numerical': 0.03395953757225433, 'mean_word_length': 6.694444444444445, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '560870', 'license': 'MIT', 'n_tokens_mistral': 617, 'n_tokens_neox': 511, 'n_words': 114, 'path': 'matplotlib basics/matplotlib 6.ipynb', 'repo_name': 'ikaushikpal/ML_Prerequisite', 'size': '1384'}