4.4.2.2.1. statsmodels.formula.formulatools.NAAction

class statsmodels.formula.formulatools.NAAction(on_NA='drop', NA_types=['None', 'NaN'])[source]

The NAAction constructor takes the following arguments:

Parameters:
  • on_NA – How to handle missing values. The default is "drop", which removes all rows from all matrices which contain any missing values. Also available is "raise", which raises an exception when any missing values are encountered.
  • NA_types

    Which rules are used to identify missing values, as a list of strings. Allowed values are:

    • "None": treat the None object as missing in categorical data.
    • "NaN": treat floating point NaN values as missing in categorical and numerical data.

New in version 0.2.0.

__init__(on_NA='drop', NA_types=['None', 'NaN'])[source]

The NAAction constructor takes the following arguments:

Parameters:
  • on_NA – How to handle missing values. The default is "drop", which removes all rows from all matrices which contain any missing values. Also available is "raise", which raises an exception when any missing values are encountered.
  • NA_types

    Which rules are used to identify missing values, as a list of strings. Allowed values are:

    • "None": treat the None object as missing in categorical data.
    • "NaN": treat floating point NaN values as missing in categorical and numerical data.

New in version 0.2.0.

4.4.2.2.1.1. Methods

__init__([on_NA, NA_types]) The NAAction constructor takes the following arguments:
handle_NA(values, is_NAs, origins) Takes a set of factor values that may have NAs, and handles them appropriately.
is_categorical_NA(obj) Return True if obj is a categorical NA value.
is_numerical_NA(arr) Returns a 1-d mask array indicating which rows in an array of numerical values contain at least one NA value.