🌐
NumPy
numpy.org › doc › stable › reference › arrays.ndarray.html
The N-dimensional array (ndarray) — NumPy v2.4 Manual
Arithmetic and comparison operations on ndarrays are defined as element-wise operations, and generally yield ndarray objects as results. Each of the arithmetic operations (+, -, *, /, //, %, divmod(), ** or pow(), <<, >>, &, ^, |, ~) and the comparisons (==, <, >, <=, >=, !=) is equivalent to the corresponding universal function (or ufunc for short) in NumPy.
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.ndarray.html
numpy.ndarray — NumPy v2.1 Manual
These examples illustrate the low-level ndarray constructor. Refer to the See Also section above for easier ways of constructing an ndarray. ... >>> import numpy as np >>> np.ndarray(shape=(2,2), dtype=float, order='F') array([[0.0e+000, 0.0e+000], # random [ nan, 2.5e-323]])
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.ndarray.html
numpy.ndarray — NumPy v2.4 Manual
These examples illustrate the low-level ndarray constructor. Refer to the See Also section above for easier ways of constructing an ndarray. ... >>> import numpy as np >>> np.ndarray(shape=(2,2), dtype=float, order='F') array([[0.0e+000, 0.0e+000], # random [ nan, 2.5e-323]])
🌐
NumPy
numpy.org › doc › 2.3 › reference › generated › numpy.ndarray.html
numpy.ndarray — NumPy v2.3 Manual
These examples illustrate the low-level ndarray constructor. Refer to the See Also section above for easier ways of constructing an ndarray. ... >>> import numpy as np >>> np.ndarray(shape=(2,2), dtype=float, order='F') array([[0.0e+000, 0.0e+000], # random [ nan, 2.5e-323]])
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.ndarray.html
numpy.ndarray — NumPy v2.2 Manual
These examples illustrate the low-level ndarray constructor. Refer to the See Also section above for easier ways of constructing an ndarray. ... >>> import numpy as np >>> np.ndarray(shape=(2,2), dtype=float, order='F') array([[0.0e+000, 0.0e+000], # random [ nan, 2.5e-323]])
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.ndarray.html
numpy.ndarray — NumPy v2.6.dev0 Manual
These examples illustrate the low-level ndarray constructor. Refer to the See Also section above for easier ways of constructing an ndarray. ... >>> import numpy as np >>> np.ndarray(shape=(2,2), dtype=np.float64, order='F') array([[0.0e+000, 0.0e+000], # random [ nan, 2.5e-323]])
🌐
GitHub
github.com › numpy › numpy › blob › main › doc › source › reference › arrays.ndarray.rst
numpy/doc/source/reference/arrays.ndarray.rst at main · numpy/numpy
That is, an ndarray can be a "view" to another ndarray, and the data it is referring to is taken care of by the "base" ndarray. ndarrays can also be views to memory owned by Python :class:`strings <str>` or objects implementing the :class:`memoryview` or :ref:`array <arrays.interface>` interfaces. ... .. try_examples:: A 2-dimensional array of size 2 x 3, composed of 4-byte integer elements: >>> import numpy as np >>> x = np.array([[1, 2, 3], [4, 5, 6]], np.int32) >>> type(x) <class 'numpy.ndarray'> >>> x.shape (2, 3) >>> x.dtype dtype('int32') The array can be indexed using Python container-like syntax: >>> # The element of x in the *second* row, *third* column, namely, 6.
Author   numpy
🌐
NumPy
numpy.org › devdocs › reference › arrays.ndarray.html
The N-dimensional array (ndarray) — NumPy v2.5.dev0 Manual
Arithmetic and comparison operations on ndarrays are defined as element-wise operations, and generally yield ndarray objects as results. Each of the arithmetic operations (+, -, *, /, //, %, divmod(), ** or pow(), <<, >>, &, ^, |, ~) and the comparisons (==, <, >, <=, >=, !=) is equivalent to the corresponding universal function (or ufunc for short) in NumPy.
🌐
NumPy
numpy.org › doc › 2.1 › reference › arrays.ndarray.html
The N-dimensional array (ndarray) — NumPy v2.1 Manual
Arithmetic and comparison operations on ndarrays are defined as element-wise operations, and generally yield ndarray objects as results. Each of the arithmetic operations (+, -, *, /, //, %, divmod(), ** or pow(), <<, >>, &, ^, |, ~) and the comparisons (==, <, >, <=, >=, !=) is equivalent to the corresponding universal function (or ufunc for short) in NumPy.
Find elsewhere
🌐
NumPy
numpy.org › doc › 2.2 › reference › arrays.ndarray.html
The N-dimensional array (ndarray) — NumPy v2.2 Manual
Arithmetic and comparison operations on ndarrays are defined as element-wise operations, and generally yield ndarray objects as results. Each of the arithmetic operations (+, -, *, /, //, %, divmod(), ** or pow(), <<, >>, &, ^, |, ~) and the comparisons (==, <, >, <=, >=, !=) is equivalent to the corresponding universal function (or ufunc for short) in NumPy.
🌐
NumPy
numpy.org › doc › 2.0 › reference › generated › numpy.ndarray.html
numpy.ndarray — NumPy v2.0 Manual
>>> np.ndarray(shape=(2,2), dtype=float, order='F') array([[0.0e+000, 0.0e+000], # random [ nan, 2.5e-323]])
🌐
Codecademy
codecademy.com › docs › python:numpy › ndarray
Python:NumPy | ndarray | Codecademy
August 24, 2025 - Calculates the product of all elements in a NumPy array, optionally along a specified axis. ... Returns a contiguous flattened array. ... Returns the repeated elements of an array. ... Rearranges the data of an ndarray into a new shape.
🌐
NumPy
numpy.org › doc › stable › user › quickstart.html
NumPy quickstart — NumPy v2.4 Manual
The reshape function returns its argument with a modified shape, whereas the ndarray.resize method modifies the array itself:
🌐
University of Texas at Austin
het.as.utexas.edu › HET › Software › Numpy › reference › generated › numpy.ndarray.html
numpy.ndarray — NumPy v1.9 Manual
>>> np.ndarray(shape=(2,2), dtype=float, order='F') array([[ -1.13698227e+002, 4.25087011e-303], [ 2.88528414e-306, 3.27025015e-309]]) #random
🌐
TutorialsPoint
tutorialspoint.com › numpy › numpy_ndarray_object.htm
NumPy - Ndarray Object
import numpy as np a = np.array([1, 2, 3, 4, 5], ndmin=2) print(a) ... An ndarray object consists of a contiguous block of memory. This means that all elements in the array are stored in a single, continuous segment of memory.
🌐
NumPy
numpy.org › doc › 1.16 › reference › generated › numpy.ndarray.html
numpy.ndarray — NumPy v1.16 Manual
February 18, 2020 - >>> np.ndarray(shape=(2,2), dtype=float, order='F') array([[ -1.13698227e+002, 4.25087011e-303], [ 2.88528414e-306, 3.27025015e-309]]) #random
🌐
GeeksforGeeks
geeksforgeeks.org › numpy › numpy-ndarray
Numpy - ndarray - GeeksforGeeks
July 26, 2025 - NumPy allows indexing and slicing operations on ndarrays which offers more flexibility compared to standard Python lists.
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.ndarray.item.html
numpy.ndarray.item — NumPy v2.2 Manual
>>> import numpy as np >>> np.random.seed(123) >>> x = np.random.randint(9, size=(3, 3)) >>> x array([[2, 2, 6], [1, 3, 6], [1, 0, 1]]) >>> x.item(3) 1 >>> x.item(7) 0 >>> x.item((0, 1)) 2 >>> x.item((2, 2)) 1
🌐
DataCamp
datacamp.com › doc › numpy › ndarrays
NumPy ndarrays
The `ndarray` is used whenever you need to perform efficient mathematical operations on large datasets, particularly when handling multi-dimensional data for scientific computing. Its syntax involves creating arrays using functions like `numpy.array()`, with the optional `dtype` parameter to specify data types for optimized performance and storage.