atleast_1d

probnum.utils.atleast_1d(*rvs)[source]

Convert arrays or random variables to arrays or random variables with at least one dimension.

Scalar inputs are converted to 1-dimensional arrays, whilst higher-dimensional inputs are preserved. Sparse arrays are not transformed.

Parameters:rvs (array-like or RandomVariable) – One or more input random variables or arrays.
Returns:res – An array / random variable or list of arrays / random variables, each with a.ndim >= 1.
Return type:array-like or list

See also

atleast_2d()