4.4.2.2.1.1.2. statsmodels.formula.formulatools.NAAction.handle_NA

NAAction.handle_NA(values, is_NAs, origins)[source]

Takes a set of factor values that may have NAs, and handles them appropriately.

Parameters:
  • values – A list of ndarray objects representing the data. These may be 1- or 2-dimensional, and may be of varying dtype. All will have the same number of rows (or entries, for 1-d arrays).
  • is_NAs – A list with the same number of entries as values, containing boolean ndarray objects that indicate which rows contain NAs in the corresponding entry in values.
  • origins – A list with the same number of entries as values, containing information on the origin of each value. If we encounter a problem with some particular value, we use the corresponding entry in origins as the origin argument when raising a PatsyError.
Returns:

A list of new values (which may have a differing number of rows.)