Function frqBin

Bins data into nbin equal frequency bins, indexed from 0 to nbin - 1, with 0 being the smallest bin, etc. The values returned are the bin index for each element.

Ret[] frqBin(Ret, T) (
  T data,
  uint nbin,
  Ret[] buf = null
)
if (doubleInput!T && isForwardRange!T && hasLength!T && isIntegral!Ret);

Default return type is ubyte, because in the dstats.infotheory, entropy() and related functions specialize on ubytes, and become substandially faster. However, if you're using more than 256 bins, you'll have to provide a different return type as a template parameter.