ibis.expr.api.NumericArray.bucket

NumericArray.bucket(arg, buckets, closed='left', close_extreme=True, include_under=False, include_over=False)

Compute a discrete binning of a numeric array

Parameters:

arg : numeric array expression

buckets : list

closed : {‘left’, ‘right’}, default ‘left’

Which side of each interval is closed. For example buckets = [0, 100, 200] closed = ‘left’: 100 falls in 2nd bucket closed = ‘right’: 100 falls in 1st bucket

close_extreme : boolean, default True

Returns:

bucketed : coded value expression