Group By: split-apply-combine

By ?group by? we are referring to a process involving one or more of the following steps Splitting the data into groups based on some criteria Applying a function to each group independently Combining the results into a data structure Of these, the split step is the most straightforward. In fact, in many situations you may wish to split the data set into groups and do something with those groups yourself. In the apply step, we might wish to one of the following: Aggregation: computing

Series.dt()

Series.dt() [source] Accessor object for datetimelike properties of the Series values. Examples >>> s.dt.hour >>> s.dt.second >>> s.dt.quarter Returns a Series indexed like the original Series. Raises TypeError if the Series does not contain datetimelike values.

SeriesGroupBy.nunique()

SeriesGroupBy.nunique(dropna=True) [source] Returns number of unique elements in the group

Series.describe()

Series.describe(percentiles=None, include=None, exclude=None) [source] Generate various summary statistics, excluding NaN values. Parameters: percentiles : array-like, optional The percentiles to include in the output. Should all be in the interval [0, 1]. By default percentiles is [.25, .5, .75], returning the 25th, 50th, and 75th percentiles. include, exclude : list-like, ?all?, or None (default) Specify the form of the returned result. Either: None to both (default). The result will

Index.unique()

Index.unique() [source] Return Index of unique values in the object. Significantly faster than numpy.unique. Includes NA values. The order of the original is preserved. Returns: uniques : Index

Panel4D.align()

Panel4D.align(other, **kwargs) [source]

Series.combine_first()

Series.combine_first(other) [source] Combine Series values, choosing the calling Series?s values first. Result index will be the union of the two indexes Parameters: other : Series Returns: y : Series

Series.where()

Series.where(cond, other=nan, inplace=False, axis=None, level=None, try_cast=False, raise_on_error=True) [source] Return an object of same shape as self and whose corresponding entries are from self where cond is True and otherwise are from other. Parameters: cond : boolean NDFrame, array or callable If cond is callable, it is computed on the NDFrame and should return boolean NDFrame or array. The callable must not change input NDFrame (though pandas doesn?t check it). New in version 0.1

Panel4D.to_long()

Panel4D.to_long(*args, **kwargs) [source]

Index.T

Index.T return the transpose, which is by definition self