chaospy.atleast_1d

chaospy.atleast_1d(*arys: Union[numpy._typing._array_like._SupportsArray[numpy.dtype], numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy._typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]], numpoly.baseclass.ndpoly]) Union[numpoly.baseclass.ndpoly, List[numpoly.baseclass.ndpoly]][source]

Convert inputs to arrays with at least one dimension.

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

Args:
arys:

One or more input arrays.

Return:

An array, or list of arrays, each with a.ndim >= 1. Copies are made only if necessary.

Example:
>>> numpoly.atleast_1d(numpoly.variable())
polynomial([q0])
>>> numpoly.atleast_1d(1, [2, 3])
[polynomial([1]), polynomial([2, 3])]