Skip to content

MissingRatio(ratio, comparison=RatioComparison.AT_LEAST) Source

A ratio of missing values from which a row or a column is removed, used by MissingDrop.

The ratio of a row is its missing values divided by its number of values, and the same for a column.

Added in version 0.1.0

Parameters:

Raises:

Examples:

import numdaplot as ndp

prices = ndp.Array.from_list([120.0, None, 80.0, None])
stocks = ndp.Array.from_list([3.0, 5.0, None, 2.0])
table = ndp.Table.from_arrays({"price": prices, "stock": stocks})
table.drop_missing(ndp.MissingDrop(rule=ndp.MissingRatio(0.4)), axis=ndp.Axis.EACH_COLUMN)
#     stock
#   FLOAT64
# 0     3.0
# 1     5.0
# 2     NaN
# 3     2.0