buckets package

Submodules

buckets.bin_data module

buckets.bin_data.bin_n(x, y, n)

Bins the input data x into ‘n’ bins and calculates the mean of y in those bins. Each bin contains the same number of elements.

Parameters:
  • x (array-like) – x value to bin y value data by.
  • y (array-like) – y value to average over each x bin.
  • n (int) – Number of elements to include in each bin.
Returns:

  • X (np.array) – Bin centers.
  • Y (np.array) – Average values of y in each bin.
  • S (np.array) – Standard deviation of y in each bin.
  • Sm (np.array) – Standard error of y in each bin.

buckets.bin_data.bin_x(x, y, gx)

Bins the input data x into centers at gx and calculates the mean of y in those bins.

Parameters:
  • x (array-like) – x value to bin y value data by.
  • y (array-like) – y value to average over each x bin.
  • gx (array-like) – Bin centers over which to calculate averages of y.
Returns:

  • bin_means (np.array) – Mean of y in each bin.
  • bin_std (np.array) – Standard deviation of y in each bin.
  • N (np.array) – Number of elements in each bin.

buckets.bin_data.standardarray(x)

Make sure an array is a np.array object.

Parameters:x (array-like) – Array-like object to turn into a numpy array.
Returns:x – Converted array.
Return type:np.array

Module contents