728x90
반응형
In [ ]:
import pandas as pd
In [5]:
url = 'https://raw.githubusercontent.com/justmarkham/DAT8/master/data/drinks.csv'
drinks = pd.read_csv(url,',')
drinks.head()
Out[5]:
In [18]:
drinks.groupby('continent')['beer_servings'].mean()
Out[18]:
In [19]:
drinks.groupby('continent')['wine_servings'].describe()
Out[19]:
In [27]:
drinks.groupby('continent').mean()
Out[27]:
In [28]:
drinks.groupby('continent').median()
Out[28]:
In [33]:
drinks.groupby('continent').spirit_servings.agg(['mean','min','max'])
# agg로 합치기
Out[33]:
728x90
반응형