Comparison with R / R libraries

Since pandas aims to provide a lot of the data manipulation and analysis functionality that people use R for, this page was started to provide a more detailed look at the R language and its many third party libraries as they relate to pandas. In comparisons with R and CRAN libraries, we care about the following things: Functionality / flexibility: what can/cannot be done with each tool Performance: how fast are operations. Hard numbers/benchmarks are preferable Ease-of-use: Is one tool eas

Series.order()

Series.order(na_last=None, ascending=True, kind='quicksort', na_position='last', inplace=False) [source] DEPRECATED: use Series.sort_values() Sorts Series object, by value, maintaining index-value link. This will return a new Series by default. Series.sort is the equivalent but as an inplace method. Parameters: na_last : boolean (optional, default=True)?DEPRECATED; use na_position Put NaN?s at beginning or end ascending : boolean, default True Sort ascending. Passing False sorts descend

Series.isnull()

Series.isnull() [source] Return a boolean same-sized object indicating if the values are null. See also notnull boolean inverse of isnull

Rolling.cov()

Rolling.cov(other=None, pairwise=None, ddof=1, **kwargs) [source] rolling sample covariance Parameters: other : Series, DataFrame, or ndarray, optional if not supplied then will default to self and produce pairwise output pairwise : bool, default None If False then only matching columns between self and other will be used and the output will be a DataFrame. If True then all pairwise combinations will be calculated and the output will be a Panel in the case of DataFrame inputs. In the ca

Series.shift()

Series.shift(periods=1, freq=None, axis=0) [source] Shift index by desired number of periods with an optional time freq Parameters: periods : int Number of periods to move, can be positive or negative freq : DateOffset, timedelta, or time rule string, optional Increment to use from the tseries module or time rule (e.g. ?EOM?). See Notes. axis : {0, ?index?} Returns: shifted : Series Notes If freq is specified then the index values are shifted but the data is not realigned. That is,

Panel.get_dtype_counts()

Panel.get_dtype_counts() [source] Return the counts of dtypes in this object.

Panel4D.tail()

Panel4D.tail(n=5) [source]

Series.str.encode()

Series.str.encode(encoding, errors='strict') [source] Encode character string in the Series/Index using indicated encoding. Equivalent to str.encode(). Parameters: encoding : str errors : str, optional Returns: encoded : Series/Index of objects

CategoricalIndex.get_loc()

CategoricalIndex.get_loc(key, method=None) [source] Get integer location for requested label Parameters: key : label method : {None} default: exact matches only. Returns: loc : int if unique index, possibly slice or mask if not

Styler.applymap()

Styler.applymap(func, subset=None, **kwargs) [source] Apply a function elementwise, updating the HTML representation with the result. New in version 0.17.1. Parameters: func : function func should take a scalar and return a scalar subset : IndexSlice a valid indexer to limit data to before applying the function. Consider using a pandas.IndexSlice kwargs : dict pass along to func Returns: self : Styler