# -*- coding: utf-8 -*-
"""
Created on Mon May 15 15:21:52 2023

@author: black
"""

import matplotlib.pyplot as plt
import pandas as pd

df = pd.DataFrame({
    'name':['Kim','Lee','Park','Choi','Hong','Chung','Jang'],
    'age':[22,26,78,17,46,32,21],
    'city':['Seoul','Busan','Seoul','Busan','Seoul','Daejun','Daejun'],
    'children':[2,3,0,1,3,4,3],
    'pets':[0,1,0,2,2,0,3]
})
'''
df.plot(kind='line', x='name', y='pets', color='red')
plt.show()
'''

'''
ax = plt.gca()

df.plot(kind='line',x='name',y='children',ax=ax)
df.plot(kind='line',x='name',y='pets', color='red', ax=ax)

plt.show()
'''

'''
df.plot(kind='bar',x='name',y='age')
plt.show()
'''

'''
df.plot(kind='scatter',x='children',y='pets',color='red')
plt.show()
'''


df.groupby('city')['name'].nunique().plot(kind='bar')
plt.show()


'''
df[['age']].plot(kind='hist', bins=[0, 20, 40, 60, 80, 100], rwidth=0.8)
plt.show()
'''

