alphatwirl.binning.Round

class alphatwirl.binning.Round(width=1, aboundary=None, min=None, underflow_bin=None, max=None, overflow_bin=None, valid=None)[source]

Equal width binning

Parameters:
  • width (float or int, default 1) – The width.
  • aboundary (float or int, optional) – A boundary. If not given, width/2 will be used.
  • min (float or int, optional) – The lowest bin will be the bin that min falls in. If given, __call__(val) returns underflow_bin if the val is less than the lower edge of the lowest bin.
  • underflow_bin (optional) – The underflow bin. When min is given, the __call__(val) returns underflow_bin if the val is less than the lower edge of the lowest bin.
  • max (float or int, optional) – The highest bin will be the bin that max falls in except when max is one of boundaries. When max is one of boundaries, the highest bin is the bin whose upper edge is max. If given, __call__(val) returns the overflow bin if the val is greater than or equal to the upper edge of the highest bin.
  • overflow_bin (optional) – The overflow bin if overflow_bin is any value other than True. If overflow_bin is True, the overflow bin will be the upper edge of the highest bin. When max is given, the __call__(val) returns the overflow bin if the val is greater than or equal to the upper edge of the highest bin.
  • valid (function, optional) – Boolean function to test if value is valid
__init__(width=1, aboundary=None, min=None, underflow_bin=None, max=None, overflow_bin=None, valid=None)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__([width, aboundary, min, …]) Initialize self.
next(bin)