{ } Raw JSON

bundles / scipy latest / scipy / stats / _distn_infrastructure / argsreduce

function

scipy.stats._distn_infrastructure:argsreduce

source: /scipy/stats/_distn_infrastructure.py :612

Signature

def   argsreduce ( cond * args )

Summary

Clean arguments to:

Extended Summary

  • Ensure all arguments are iterable (arrays of dimension at least one

  • If cond != True and size > 1, ravel(args[i]) where ravel(condition) is True, in 1D.

Return list of processed arguments.

Examples

import numpy as np
from scipy.stats._distn_infrastructure import argsreduce
rng = np.random.default_rng()
A = rng.random((4, 5))
B = 2
C = rng.random((1, 5))
cond = np.ones(A.shape)
[A1, B1, C1] = argsreduce(cond, A, B, C)
A1.shape
B1.shape
C1.shape
cond[2,:] = 0
[A1, B1, C1] = argsreduce(cond, A, B, C)
A1.shape
B1.shape
C1.shape

Aliases

  • scipy.stats._distn_infrastructure.argsreduce