# -*- coding: utf-8 -*-
"""
Created on Sun Jan  2 13:32:34 2022

@author: Sim
"""
import pandas as pd
import matplotlib.pyplot as plt

df = pd.read_csv(r'D:\HTEX\Pythonbk\codesdata\bmi.csv')

ftab = df['gender'].value_counts()
plt.bar(x=ftab.index, height=ftab.values)
plt.show()
plt.pie(ftab, labels=ftab.index)
plt.show()

mm = df.groupby('gender')['height'].mean()
plt.bar(x=mm.index, height=mm.values)
plt.show()

fig, (ax1, ax2) = plt.subplots(1,2)
ax1.hist(df['height'], edgecolor='white')
ax2.hist(df['weight'], edgecolor='white' )
plt.show()


grouped = df.groupby('gender')['height']
glist = grouped.aggregate(lambda x: list(x))
plt.boxplot(glist)
plt.show()

