Skip to content

Bounds Source

Bases: Enum

Which bounds of an interval are part of it, used by Between and Range.

Added in version 0.1.0

Examples:

import numdaplot as ndp

scores = ndp.Array.from_list([0, 5, 10])
scores.select(ndp.Between(low=0, high=10, bounds=ndp.Bounds.LOW_ONLY))
# Array([0, 5], dtype=INT64)

Attributes

INCLUDED = auto() Source

Both bounds are included: low <= x <= high. Default value.

Added in version 0.1.0

Examples:

import numdaplot as ndp

ages = ndp.Array.from_list([10, 15, 20])
ages.select(ndp.Between(low=10, high=20, bounds=ndp.Bounds.INCLUDED))
# Array([10, 15, 20], dtype=INT64)

EXCLUDED = auto() Source

Both bounds are excluded: low < x < high.

Added in version 0.1.0

Examples:

import numdaplot as ndp

ages = ndp.Array.from_list([10, 15, 20])
ages.select(ndp.Between(low=10, high=20, bounds=ndp.Bounds.EXCLUDED))
# Array([15], dtype=INT64)

LOW_ONLY = auto() Source

Only the low bound is included: low <= x < high.

Added in version 0.1.0

Examples:

import numdaplot as ndp

ages = ndp.Array.from_list([10, 15, 20])
ages.select(ndp.Between(low=10, high=20, bounds=ndp.Bounds.LOW_ONLY))
# Array([10, 15], dtype=INT64)

HIGH_ONLY = auto() Source

Only the high bound is included: low < x <= high.

Added in version 0.1.0

Examples:

import numdaplot as ndp

ages = ndp.Array.from_list([10, 15, 20])
ages.select(ndp.Between(low=10, high=20, bounds=ndp.Bounds.HIGH_ONLY))
# Array([15, 20], dtype=INT64)