qis.utils.quantile_buckets.compute_bucket_codes

qis.utils.quantile_buckets.compute_bucket_codes(x, q, is_require_occupied=True)[source]

Quantile bucket of each observation, with the edges estimated from the observations.

Parameters:
Returns:

integer bucket per observation, -1 for a NaN or infinite observation

Raises:

EmptyQuantileBucketError – if is_require_occupied and a bucket is empty

Return type:

ndarray