yaw.core.math#

This module implements some math and array related functions.

Functions

apply_bool_mask_ndim(array, mask[, axis])

Apply a boolean mask (mask) to one or many axes of a numpy array.

array_equal(arr1, arr2)

Check if the shape and array elements of two numpy array are equal.

apply_slice_ndim(array, item[, axis])

Apply an integer subset or slice (item) to one or many axes of a numpy array.

corr_from_cov(covariance)

Convert an input covariance matrix to a covariance matrix.

cov_from_samples(samples, method[, rowvar, kind])

Compute a joint covariance from a sequence of data samples.

outer_triu_sum(a, b, *[, k, axis])

Compute the sum over the upper triangle of the outer product.

rebin(bins_new, bins_old, counts_old)

Recompute compute histogram counts for a new binning.

sgn(val)

Compute the sign of a (array of) numbers, with positive numbers and 0 returning 1, negative number returning -1.

shift_histogram(bins, counts, *[, A, dx])

Shift a histogram by a fixed value.