roaming_nbinmaker¶
- clustertools.util.recipes.roaming_nbinmaker(x, nbin=10, ntot=20, nsum=False)[source]¶
Split an array into bins with equal numbers of elements
- Parameters:
- xfloat
input array
- nbinint
number of bins to set bin fraction
- ntotint
number of total bins
- nsumbool
return number of points in each bin (default: False)
- Returns:
- x_lowerfloat
lower bin values
- x_midfloat
mean value in each bin
- x_upperfloat
upper bin values
- x_hist
number of points in bin
- if nsum==True:
- x_sumfloat
sum of point values in each bin