Skip to content

MissingDrop(columns=None, rule=MissingMode.ANY) Source

Which rows or columns holding missing values are removed, used by Table.drop_missing.

The axis, rows or columns, is given to Table.drop_missing itself.

Added in version 0.1.0

Parameters:

  • columns (list[str] | None, default: None)

    The names of the columns looked at, every column when omitted. Rows are removed according to their values in these columns; columns are only removed among them, the others are always kept. The settings keep their own copy of the list.

  • rule (MissingMode | MissingRatio, default: MissingMode.ANY)

    How many missing values make a row or a column removed: a single one by default, all of them with MissingMode.ALL, or a share of them with MissingRatio. In a Table without rows, no column is removed.

Raises:

Examples:

import numdaplot as ndp

cities = ndp.Array.from_list(["Paris", "Lyon", "Pau"])
prices = ndp.Array.from_list([120.0, None, 150.0])
table = ndp.Table.from_arrays({"city": cities, "price": prices})
table.drop_missing()
#     city   price
#     TEXT FLOAT64
# 0  Paris   120.0
# 1    Pau   150.0
table.drop_missing(ndp.MissingDrop(columns=["price"]), axis=ndp.Axis.EACH_COLUMN)
#     city
#     TEXT
# 0  Paris
# 1   Lyon
# 2    Pau