chaospy.atleast_3d¶
- chaospy.atleast_3d(*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 three dimensions.
- Args:
- arys:
One or more array-like sequences. Non-array inputs are converted to arrays. Arrays that already have three or more dimensions are preserved.
- Return:
An array, or list of arrays, each with
a.ndim >= 3
. Copies are avoided where possible, and views with three or more dimensions are returned. For example, a 1-D array of shape(N,)
becomes a view of shape(1, N, 1)
, and a 2-D array of shape(M, N)
becomes a view of shape(M, N, 1)
.- Example:
>>> numpoly.atleast_3d(numpoly.variable()) polynomial([[[q0]]]) >>> a, b = numpoly.atleast_3d(1, [2, 3]) >>> a polynomial([[[1]]]) >>> b polynomial([[[2], [3]]])