DataFrame.all()

DataFrame.all(axis=None, bool_only=None, skipna=None, level=None, **kwargs) [source] Return whether all elements are True over requested axis Parameters: axis : {index (0), columns (1)} skipna : boolean, default True Exclude NA/null values. If an entire row/column is NA, the result will be NA level : int or level name, default None If the axis is a MultiIndex (hierarchical), count along a particular level, collapsing into a Series bool_only : boolean, default None Include only boolean

DataFrame.add_suffix()

DataFrame.add_suffix(suffix) [source] Concatenate suffix string with panel items names. Parameters: suffix : string Returns: with_suffix : type of caller

DataFrame.add_prefix()

DataFrame.add_prefix(prefix) [source] Concatenate prefix string with panel items names. Parameters: prefix : string Returns: with_prefix : type of caller

DataFrame.add()

DataFrame.add(other, axis='columns', level=None, fill_value=None) [source] Addition of dataframe and other, element-wise (binary operator add). Equivalent to dataframe + other, but with support to substitute a fill_value for missing data in one of the inputs. Parameters: other : Series, DataFrame, or constant axis : {0, 1, ?index?, ?columns?} For Series input, axis to match Series index on fill_value : None or float value, default None Fill missing (NaN) values with this value. If both

DataFrame()

class pandas.DataFrame(data=None, index=None, columns=None, dtype=None, copy=False) [source] Two-dimensional size-mutable, potentially heterogeneous tabular data structure with labeled axes (rows and columns). Arithmetic operations align on both row and column labels. Can be thought of as a dict-like container for Series objects. The primary pandas data structure Parameters: data : numpy ndarray (structured or homogeneous), dict, or DataFrame Dict can contain Series, arrays, constants, or

DataFrame.abs()

DataFrame.abs() [source] Return an object with absolute value taken?only applicable to objects that are all numeric. Returns: abs: type of caller

Cookbook

This is a repository for short and sweet examples and links for useful pandas recipes. We encourage users to add to this documentation. Adding interesting links and/or inline examples to this section is a great First Pull Request. Simplified, condensed, new-user friendly, in-line examples have been inserted where possible to augment the Stack-Overflow and GitHub links. Many of the links contain expanded information, above what the in-line examples offer. Pandas (pd) and Numpy (np) are the only

Computational tools

Statistical Functions Percent Change Series, DataFrame, and Panel all have a method pct_change to compute the percent change over a given number of periods (using fill_method to fill NA/null values before computing the percent change). In [1]: ser = pd.Series(np.random.randn(8)) In [2]: ser.pct_change() Out[2]: 0 NaN 1 -1.602976 2 4.334938 3 -0.247456 4 -2.067345 5 -1.142903 6 -1.688214 7 -9.759729 dtype: float64 In [3]: df = pd.DataFrame(np.random.randn(10, 4)) In

Comparison with SQL

Since many potential pandas users have some familiarity with SQL, this page is meant to provide some examples of how various SQL operations would be performed using pandas. If you?re new to pandas, you might want to first read through 10 Minutes to pandas to familiarize yourself with the library. As is customary, we import pandas and numpy as follows: In [1]: import pandas as pd In [2]: import numpy as np Most of the examples will utilize the tips dataset found within pandas tests. We?ll rea

Comparison with SAS

For potential users coming from SAS this page is meant to demonstrate how different SAS operations would be performed in pandas. If you?re new to pandas, you might want to first read through 10 Minutes to pandas to familiarize yourself with the library. As is customary, we import pandas and numpy as follows: In [1]: import pandas as pd In [2]: import numpy as np Note Throughout this tutorial, the pandas DataFrame will be displayed by calling df.head(), which displays the first N (default 5)