🌐
NumPy
numpy.org › doc › 2.4 › 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 › devdocs › reference › generated › numpy.ndarray.html
numpy.ndarray — NumPy v2.6.dev0 Manual
class numpy.ndarray(shape, dtype=np.float64, buffer=None, offset=0, strides=None, order=None)[source]#
🌐
NumPy
numpy.org › doc › stable › reference › arrays.ndarray.html
The N-dimensional array (ndarray) — NumPy v2.5 Manual
An ndarray is a (usually fixed-size) multidimensional container of items of the same type and size. The number of dimensions and items in an array is defined by its shape, which is a tuple of N non-negative integers that specify the sizes of each dimension.
🌐
GeeksforGeeks
geeksforgeeks.org › numpy › numpy-ndarray
Numpy - ndarray - GeeksforGeeks
July 26, 2025 - ndarray is a short form for N-dimensional array which is a important component of NumPy. It’s allows us to store and manipulate large amounts of data efficiently. All elements in an ndarray must be of same type making it a homogeneous array.
🌐
W3Schools
w3schools.com › python › numpy › numpy_intro.asp
Introduction to NumPy
The array object in NumPy is called ndarray, it provides a lot of supporting functions that make working with ndarray very easy.
numerical programming package for the Python programming language
NumPy (pronounced /ˈnʌmpaɪ/ NUM-py) is a library for the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on … Wikipedia
Factsheet
Original author Travis Oliphant
Developer Community project
Release As Numeric, 1995; as NumPy, 2006
Factsheet
Original author Travis Oliphant
Developer Community project
Release As Numeric, 1995; as NumPy, 2006
🌐
NumPy
numpy.org
NumPy
Powerful N-dimensional arrays Fast and versatile, the NumPy vectorization, indexing, and broadcasting concepts are the de-facto standards of array computing today. Numerical computing tools NumPy offers comprehensive mathematical functions, random number generators, linear algebra routines, ...
🌐
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]])
Find elsewhere
🌐
DataCamp
datacamp.com › doc › numpy › ndarrays
NumPy ndarrays
NumPy's `ndarray` is a powerful N-dimensional array object that forms the core of the NumPy library, enabling efficient storage and manipulation of large datasets.
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.ndarray.html
numpy.ndarray — NumPy v2.5 Manual
class numpy.ndarray(shape, dtype=np.float64, buffer=None, offset=0, strides=None, order=None)[source]#
🌐
NumPy
numpy.org › doc › stable › user › quickstart.html
NumPy quickstart — NumPy v2.5 Manual
NumPy’s array class is called ndarray. It is also known by the alias array. Note that numpy.array is not the same as the Standard Python Library class array.array, which only handles one-dimensional arrays and offers less functionality.
🌐
NumPy
numpy.org › doc › 2.4 › reference › arrays.ndarray.html
The N-dimensional array (ndarray) — NumPy v2.4 Manual
An ndarray is a (usually fixed-size) multidimensional container of items of the same type and size. The number of dimensions and items in an array is defined by its shape, which is a tuple of N non-negative integers that specify the sizes of each dimension.
🌐
APXML
apxml.com › courses › essential-numpy-pandas › chapter-2-getting-started-numpy-arrays › understanding-ndarrays
What is a NumPy ndarray?
At the core of NumPy is its primary data structure: the N-dimensional array, often referred to as the ndarray. Think of it as a highly efficient, flexible container designed specifically for numerical data. While standard Python lists are versatile, they are not optimized for the kind of ...
🌐
W3Schools
w3schools.com › python › numpy › numpy_creating_arrays.asp
NumPy Creating Arrays
NumPy is used to work with arrays. The array object in NumPy is called ndarray.
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.ndarray.dtype.html
numpy.ndarray.dtype — NumPy v2.2 Manual
Setting arr.dtype is discouraged and may be deprecated in the future. Setting will replace the dtype without modifying the memory (see also ndarray.view and ndarray.astype).
🌐
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]])
🌐
CodingNomads
codingnomads.com › arrays-in-numpy-ndarray
Arrays in NumPy: ndarray, np.empty, np.arange, np.linspace
The NumPy ndarray is a multidimensional array of elements all of the same type. The number of dimensions and items in an array is defined by its shape, which is a tuple of N non-negative integers that specify the sizes of each dimension.
🌐
NumPy
numpy.org › doc › 2.4 › reference › arrays.html
Array objects — NumPy v2.4 Manual
NumPy provides an N-dimensional array type, the ndarray, which describes a collection of “items” of the same type.
Top answer
1 of 2
2

There's no difference; they're identical.

numpy.ndarray is the actual type of numpy arrays; <class 'numpy.ndarray'> is the string represention ot numpy.ndarray:

>>> import numpy as np
>>> a = np.array([1, 2, 3])
array([1, 2, 3])

>>> print(type(a) == np.ndarray)
True

>>> np.ndarray
<class 'numpy.ndarray'>

>>> print(type(a))
<class 'numpy.ndarray'>

>>> str(type(a))
"<class 'numpy.ndarray'>"

>>> repr(type(a))
"<class 'numpy.ndarray'>"

Python interpreters such as IPython and Jupyter (which underneath are actually the same thing) will trim of the <class '...' > part and only show the type itself when you enter the type the into interpreter, e.g. ipython:

$ ipython
Python 3.9.9 (main, Nov 21 2021, 03:23:44) 
Type 'copyright', 'credits' or 'license' for more information
IPython 8.1.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import numpy as np

In [2]: np.ndarray
Out[2]: numpy.ndarray

...versus python (the builtin interpreter):

$ python3
Python 3.9.9 (main, Nov 21 2021, 03:23:44) 
[Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.ndarray
<class 'numpy.ndarray'>

...but they're the exact same type.

2 of 2
1

I wonder if you are confusing numpy arrays and python lists. I/we often talk about a numpy array, meaning actually an object of class/type np.ndarray.

In [144]: a = [1, 2, 3]         # a list
In [145]: b = np.array(a)       # an array
In [146]: type(a), type(b)
Out[146]: (list, numpy.ndarray)

Your expression works with the array, but not the list:

In [147]: (b == 1).sum()
Out[147]: 1
In [148]: (a == 1).sum()
Traceback (most recent call last):
  Input In [148] in <module>
    (a == 1).sum()
AttributeError: 'bool' object has no attribute 'sum'

In [149]: b == 1
Out[149]: array([ True, False, False])
In [150]: a == 1
Out[150]: False

Note that I created b with np.array(). There is a np.ndarray function, but we don't usually use it - it's a low level creator that most of us don't need. A useful starting page:

https://numpy.org/doc/1.22/user/basics.creation.html