pandas as pd
from pandas import Series, DataFrame
results = (pd.Series(draws)
.groupby(bins)...dtype: object
dim.take(values) # take方法
0 apple
1 orange
0 apple
0 apple
0 apple...1 orange
0 apple
0 apple
dtype: object
pandas分类类型
fruits = ['apple', 'orange', 'apple', '...'>
c = fruit_cat.valuest
type(c) # c是⼀个pandas.Categorical实例
pandas.core.arrays.categorical.Categorical...): [Q1 < Q2 < Q3 < Q4]
bins.codes[:10]
array([1, 2, 1, 1, 3, 3, 2, 2, 3, 3], dtype=int8)
# groupby 提取汇总信息