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. :param rvs: One or more input random variables or arrays. :type rvs: array-like or RandomVariable

Returns

res – An array / random variable or list of arrays / random variables, each with a.ndim >= 1.

Return type

array-like or list