coherent_score_mz_fast.rand_choice_nb#

Back to Module page

Summary#

Signature#

def rand_choice_nb(arr, cprob, nvals)
Input variables#

Name

Type

Default

Description

arr

A nD numpy array of values to sample from

cprob

A 1D numpy array of cumulative probabilities for the given samples

nvals

Number of samples desired

Output variables#

Return annotation

Docstring type

Description

None

nvals random samples from the given array with a given probability

Docstring#

:param arr: A nD numpy array of values to sample from
:param cprob:
    A 1D numpy array of cumulative probabilities for the given samples
:param nvals: Number of samples desired
:return: nvals random samples from the given array with a given probability