coherent_score_mz_fast.rand_choice_nb#
Back to Module page
Summary#
Signature#
def rand_choice_nb(arr, cprob, nvals)
Name |
Type |
Default |
Description |
|---|---|---|---|
|
A nD numpy array of values to sample from |
||
|
A 1D numpy array of cumulative probabilities for the given samples |
||
|
Number of samples desired |
Output variables#
Return annotation |
Docstring type |
Description |
|---|---|---|
|
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