相關數據見(github)html
import pandas as pd
path3 = "./data/drinks.csv" # drinks.csv
drinks = pd.read_csv(path3) drinks.head()
輸出:python
beeravg = drinks.groupby('continent').beer_servings.mean() beeravg.sort_values(ascending=False)
輸出:git
drinks.groupby('continent').wine_servings.describe()
輸出:github
drinks.groupby('continent').mean()
輸出:ui
drinks.groupby('continent').median()
輸出:spa
drinks.groupby('continent').spirit_servings.agg(['mean', 'min', 'max'])
輸出:3d
一、http://pandas.pydata.org/pandas-docs/stable/cookbook.html#cookbookcode
二、https://www.analyticsvidhya.com/blog/2016/01/12-pandas-techniques-python-data-manipulation/htm