GroupBy.median()

GroupBy.median() [source] Compute median of groups, excluding missing values For multiple groupings, the result index will be a MultiIndex See also pandas.Series.groupby, pandas.DataFrame.groupby, pandas.Panel.groupby

GroupBy.max()

GroupBy.max() [source] Compute max of group values See also pandas.Series.groupby, pandas.DataFrame.groupby, pandas.Panel.groupby

GroupBy.last()

GroupBy.last() [source] Compute last of group values See also pandas.Series.groupby, pandas.DataFrame.groupby, pandas.Panel.groupby

GroupBy.groups

GroupBy.groups dict {group name -> group labels}

GroupBy.indices

GroupBy.indices dict {group name -> group indices}

GroupBy.head()

GroupBy.head(n=5) [source] Returns first n rows of each group. Essentially equivalent to .apply(lambda x: x.head(n)), except ignores as_index flag. See also pandas.Series.groupby, pandas.DataFrame.groupby, pandas.Panel.groupby Examples >>> df = DataFrame([[1, 2], [1, 4], [5, 6]], columns=['A', 'B']) >>> df.groupby('A', as_index=False).head(1) A B 0 1 2 2 5 6 >>> df.groupby('A').head(1) A B 0 1 2 2 5 6

GroupBy.first()

GroupBy.first() [source] Compute first of group values See also pandas.Series.groupby, pandas.DataFrame.groupby, pandas.Panel.groupby

GroupBy.cumcount()

GroupBy.cumcount(ascending=True) [source] Number each item in each group from 0 to the length of that group - 1. Essentially this is equivalent to >>> self.apply(lambda x: Series(np.arange(len(x)), x.index)) Parameters: ascending : bool, default True If False, number in reverse, from length of group - 1 to 0. See also pandas.Series.groupby, pandas.DataFrame.groupby, pandas.Panel.groupby Examples >>> df = pd.DataFrame([['a'], ['a'], ['a'], ['b'], ['b'], ['a']], ...

GroupBy.get_group()

GroupBy.get_group(name, obj=None) [source] Constructs NDFrame from group with provided name Parameters: name : object the name of the group to get as a DataFrame obj : NDFrame, default None the NDFrame to take the DataFrame out of. If it is None, the object groupby was called on will be used Returns: group : type of obj

GroupBy.apply()

GroupBy.apply(func, *args, **kwargs) [source] Apply function and combine results together in an intelligent way. The split-apply-combine combination rules attempt to be as common sense based as possible. For example: case 1: group DataFrame apply aggregation function (f(chunk) -> Series) yield DataFrame, with group axis having group labels case 2: group DataFrame apply transform function ((f(chunk) -> DataFrame with same indexes) yield DataFrame with resulting chunks glued together ca