bin (pyleoclim.utils.tsutils.bin)
- pyleoclim.utils.tsutils.bin(x, y, bin_size=None, start=None, stop=None, evenly_spaced=True)[source]
Bin the values
- Parameters
x (array) – The x-axis series.
y (array) – The y-axis series.
bin_size (float) – The size of the bins. Default is the mean resolution if evenly_spaced is not True
start (float) – Where/when to start binning. Default is the minimum
stop (float) – When/where to stop binning. Default is the maximum
evenly_spaced ({True,False}) – Makes the series evenly-spaced. This option is ignored if bin_size is set to float
- Returns
binned_values (array) – The binned values
bins (array) – The bins (centered on the median, i.e., the 100-200 bin is 150)
n (array) – number of data points in each bin
error (array) – the standard error on the mean in each bin