navis.nbl.smat.Digitizer¶
- class navis.nbl.smat.Digitizer(boundaries, clip=(True, True), right=False)[source]¶
Class converting continuous values into discrete indices.
- Parameters:
boundaries (Sequence[float]) – N boundaries specifying N-1 bins. Must be monotonically increasing.
clip (Tuple[bool, bool], optional) – Whether to set the bottom and top boundaries to -infinity and infinity respectively, effectively clipping incoming values: by default (True, True). False means “add a new bin for out-of-range values”.
right (bool, optional) – Whether bins should include their right (rather than left) boundary, by default False.
- __init__(boundaries, clip=(True, True), right=False)[source]¶
Class converting continuous values into discrete indices.
- Parameters:
boundaries (Sequence[float]) – N boundaries specifying N-1 bins. Must be monotonically increasing.
clip (Tuple[bool, bool], optional) – Whether to set the bottom and top boundaries to -infinity and infinity respectively, effectively clipping incoming values: by default (True, True). False means “add a new bin for out-of-range values”.
right (bool, optional) – Whether bins should include their right (rather than left) boundary, by default False.
Methods
__init__
(boundaries[, clip, right])Class converting continuous values into discrete indices.
from_data
(data, nbins[, right, method])Choose digitizer boundaries to evenly partition the given values.
from_geom
(lowest_upper, highest_lower, nbins)Choose digitizer boundaries in a geometric sequence.
from_linear
(lower, upper, nbins[, right])Choose digitizer boundaries spaced linearly between two values.
from_strings
(interval_strs)Set digitizer boundaries based on a sequence of interval expressions.
to_strings
([round])Turn boundaries into list of labels.