bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / ma / extras / atleast_1d
function
numpy.ma.extras:atleast_1d
source: build-install/usr/lib/python3.14/site-packages/numpy/_core/shape_base.py :19
Signature
def atleast_1d ( * arys ) Summary
Convert inputs to arrays with at least one dimension.
Extended Summary
Scalar inputs are converted to 1-dimensional arrays, whilst higher-dimensional inputs are preserved.
Parameters
arys1, arys2, ...: array_likeOne or more input arrays.
Returns
ret: ndarrayAn array, or tuple of arrays, each with
a.ndim >= 1. Copies are made only if necessary.
Notes
The function is applied to both the _data and the _mask, if any.
Examples
import numpy as np np.atleast_1d(1.0)✓
x = np.arange(9.0).reshape(3,3) np.atleast_1d(x) np.atleast_1d(x) is x✓
np.atleast_1d(1, [3, 4])
✓See also
Aliases
-
numpy.ma.atleast_1d