nums.numpy.atleast_2d
nums.numpy.atleast_2d#
- nums.numpy.atleast_2d(*arys)#
View inputs as arrays with at least two dimensions.
This docstring was copied from numpy.atleast_2d.
Some inconsistencies with the NumS version may exist.
- arys1, arys2, …BlockArray
One or more array-like sequences. Non-array inputs are converted to arrays. Arrays that already have two or more dimensions are preserved.
- res, res2, …BlockArray
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.
atleast_1d, atleast_3d
The doctests shown below are copied from NumPy. They won’t show the correct result until you operate
get().>>> nps.atleast_2d(3.0).get() array([[3.]])
>>> x = nps.arange(3.0) >>> nps.atleast_2d(x).get() array([[0., 1., 2.]])
>>> [a.get() for a in nps.atleast_2d(1, [1, 2], [[1, 3]])] [array([[1]]), array([[1, 2]]), array([[1, 2]])]