This is a pre-release version (2.5.0.dev0+git20251130.2de293a). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / atleast_3d

_ArrayFunctionDispatcher

numpy:atleast_3d

source: /dev/numpy/build-install/usr/lib/python3.14/site-packages/numpy/_core/shape_base.py :137

Signature

def   atleast_3d ( * arys )

Summary

View inputs as arrays with at least three dimensions.

Parameters

arys1, arys2, ... : array_like

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

Returns

res1, res2, ... : ndarray

An array, or tuple 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).

Examples

import numpy as np
np.atleast_3d(3.0)
x = np.arange(3.0)
np.atleast_3d(x).shape
x = np.arange(12.0).reshape(4,3)
np.atleast_3d(x).shape
np.atleast_3d(x).base is x.base  # x is a reshape, so not base itself

See also

atleast_1d
atleast_2d

Aliases

  • numpy.atleast_3d

Referenced by