GroupBy.mean()

GroupBy.mean(*args, **kwargs) [source] Compute mean 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.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.groups

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

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.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.count()

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