GroupBy#
GroupBy 对象是 groupby 方法调用的结果,groupby 方法可以是 mars.dataframe.DataFrame.groupby()
或者 mars.dataframe.Series.groupby()
等。
索引和迭代#
应用函数#
|
Apply function func group-wise and combine the results together. |
|
Aggregate using one or more operations on grouped data. |
|
Aggregate using one or more operations on grouped data. |
|
Call function producing a like-indexed DataFrame on each group and return a DataFrame having the same indexes as the original object filled with the transformed values |
计算和描述统计#
|
|
|
|
|
Backward fill the values. |
|
Backward fill the values. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Forward fill the values. |
|
Return first n rows of each group. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
下面的方法对 SeriesGroupBy
和 DataFrameGroupBy
均可用,但有细微的差别。通常 DataFrameGroupBy
允许指定坐标,以及会提供一个是否将操作限制在特定数据类型上的参数。
|
|
|
|
|
|
|
|
|
|
|
Fill NA/NaN values using the specified method |
|
|
|
Return a random sample of items from each group. |
下列方法仅对 SeriesGroupBy
对象可用。
下列方法仅对 DataFrameGroupBy
对象可用。