pandas.DataFrame.groupby
pandas.DataFrame.groupby() ,反悔的结果是一个Key,value的 新的Dataframe
| Parameters: |
by : mapping function / list of functions, dict, Series, or tuple /
axis : int, default 0 level : int, level name, or sequence of such, default None
as_index : boolean, default True
sort : boolean, default True
group_keys : boolean, default True
squeeze : boolean, default False
|
|---|---|
| Returns: |
GroupBy object |
Examples
DataFrame results
>>> data.groupby(func, axis=0).mean()
>>> data.groupby(['col1', 'col2'])['col3'].mean()
DataFrame with hierarchical index
>>> data.groupby(['col1', 'col2']).mean()
| 参数: |
by : 映射函数/函数列表、字典、系列或元组/
轴:整数,默认为 0 级别:整数,级别名称或此类的序列,默认为无
as_index : 布尔值,默认为 True
排序:布尔值,默认为真
group_keys : 布尔值,默认为 True
挤压:布尔值,默认为假
|
|---|---|
| 返回: |
分组对象 |

浙公网安备 33010602011771号