DataFrame.pivot()

DataFrame.pivot(index=None, columns=None, values=None) [source] Reshape data (produce a ?pivot? table) based on column values. Uses unique values from index / columns to form axes of the resulting DataFrame. Parameters: index : string or object, optional Column name to use to make new frame?s index. If None, uses existing index. columns : string or object Column name to use to make new frame?s columns values : string or object, optional Column name to use for populating new frame?s va

DataFrame.nsmallest()

DataFrame.nsmallest(n, columns, keep='first') [source] Get the rows of a DataFrame sorted by the n smallest values of columns. New in version 0.17.0. Parameters: n : int Number of items to retrieve columns : list or str Column name or names to order by keep : {?first?, ?last?, False}, default ?first? Where there are duplicate values: - first : take the first occurrence. - last : take the last occurrence. Returns: DataFrame Examples >>> df = DataFrame({'a': [1, 10, 8, 11

DataFrame.pct_change()

DataFrame.pct_change(periods=1, fill_method='pad', limit=None, freq=None, **kwargs) [source] Percent change over given number of periods. Parameters: periods : int, default 1 Periods to shift for forming percent change fill_method : str, default ?pad? How to handle NAs before computing percent changes limit : int, default None The number of consecutive NAs to fill before stopping freq : DateOffset, timedelta, or offset alias string, optional Increment to use from time series API (e.

DataFrame.ne()

DataFrame.ne(other, axis='columns', level=None) [source] Wrapper for flexible comparison methods ne

DataFrame.notnull()

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

DataFrame.nlargest()

DataFrame.nlargest(n, columns, keep='first') [source] Get the rows of a DataFrame sorted by the n largest values of columns. New in version 0.17.0. Parameters: n : int Number of items to retrieve columns : list or str Column name or names to order by keep : {?first?, ?last?, False}, default ?first? Where there are duplicate values: - first : take the first occurrence. - last : take the last occurrence. Returns: DataFrame Examples >>> df = DataFrame({'a': [1, 10, 8, 11,

DataFrame.ndim

DataFrame.ndim Number of axes / array dimensions

DataFrame.multiply()

DataFrame.multiply(other, axis='columns', level=None, fill_value=None) [source] Multiplication of dataframe and other, element-wise (binary operator mul). 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 valu

DataFrame.mul()

DataFrame.mul(other, axis='columns', level=None, fill_value=None) [source] Multiplication of dataframe and other, element-wise (binary operator mul). 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

DataFrame.mode()

DataFrame.mode(axis=0, numeric_only=False) [source] Gets the mode(s) of each element along the axis selected. Empty if nothing has 2+ occurrences. Adds a row for each mode per label, fills in gaps with nan. Note that there could be multiple values returned for the selected axis (when more than one item share the maximum frequency), which is the reason why a dataframe is returned. If you want to impute missing values with the mode in a dataframe df, you can just do this: df.fillna(df.mode().