numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParametersReturns
atleast_1d(*args, **kwargs)

Scalar inputs are converted to 1-dimensional arrays, whilst higher-dimensional inputs are preserved.

Notes

The function is applied to both the _data and the _mask, if any.

Parameters

arys1, arys2, ... : array_like

One or more input arrays.

Returns

ret : ndarray

An array, or list of arrays, each with a.ndim >= 1 . Copies are made only if necessary.

Convert inputs to arrays with at least one dimension.

See Also

atleast_2d
atleast_3d

Examples

>>> np.atleast_1d(1.0)
array([1.])
>>> x = np.arange(9.0).reshape(3,3)
... np.atleast_1d(x) array([[0., 1., 2.], [3., 4., 5.], [6., 7., 8.]])
>>> np.atleast_1d(x) is x
True
>>> np.atleast_1d(1, [3, 4])
[array([1]), array([3, 4])]
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/ma/extras.py#None
type: <class 'numpy.ma.extras._fromnxfunction_allargs'>
Commit: