chaospy.atleast_2d

chaospy.atleast_2d(*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]

View inputs as arrays with at least two dimensions.

Args:
arys:

One or more array-like sequences. Non-array inputs are converted to arrays. Arrays that already have two or more dimensions are preserved.

Return:

An array, or list of arrays, each with a.ndim >= 2. Copies are avoided where possible, and views with two or more dimensions are returned.

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