numpy.array is just a convenience function to create an ndarray; it is not a class itself.

You can also create an array using numpy.ndarray, but it is not the recommended way. From the docstring of numpy.ndarray:

Arrays should be constructed using array, zeros or empty ... The parameters given here refer to a low-level method (ndarray(...)) for instantiating an array.

Most of the meat of the implementation is in C code, here in multiarray, but you can start looking at the ndarray interfaces here:

https://github.com/numpy/numpy/blob/master/numpy/core/numeric.py

Answer from wim on Stack Overflow
🌐
Note.nkmk.me
note.nkmk.me › home › python
List vs. Array vs. numpy.ndarray in Python | note.nkmk.me
February 5, 2024 - Although often confused, the correct type is ndarray, not array, where "nd" stands for N-dimensional. The numpy.array() function creates an ndarray.
Discussions

numpy - what is a reason to use ndarray instead of python array - Stack Overflow
I build a class with some iteration over coming data. The data are in an array form without use of numpy objects. On my code I often use .append to create another array. At some point I changed one... More on stackoverflow.com
🌐 stackoverflow.com
What is the difference between <class 'numpy.ndarray'> and numpy.ndarray? - Stack Overflow
I have been doing some calculations using numpy arrays and have arrived at the question of what is the difference between: and numpy.ndarray I have noticed that the More on stackoverflow.com
🌐 stackoverflow.com
Numpy vs Ndarray speed?
Numpy calls c/fortran functions under the hood. There should not be any major differences between the two in that regard. Especially as they can both use blas for linear algebra. For large arrays the overhead of python calling the underlying code in numpy should be negligible compared to the actual computation. However, -the low level code in numpy was refined over time and is battle tested. Hand made optimisations can beat rustc's. -you have more liberty to parallelize your operations in rust, especially with rayon (be careful of the overhead thought). In numpy, some blas function can be parallelized depending on your system but that's about it. Numpy can also waste time when computing long equations by allocating intermediary arrays, so a more fair comparison would be between ndarray and numexpr or numba. I agree that pyo3-numpy is very cool. But if your facing this kind of choices, benchmark to know what's best for your problem. You might be surprised. More on reddit.com
🌐 r/rust
7
0
January 26, 2025
What are the differences between Python Array, Numpy Array and Panda Dataframe? When do I use which?
Python array the term is "Python list" usage: everyday plain Python code NumPy array: data manipulation that needs to be fast can use Python lists if speed isn't a concern supports fast and convenient vectorized functions: write np.sqrt(array) instead of [math.sqrt(number) for number in your_list] elegantly handles arbitrary number of dimensions Pandas dataframe: for data wrangling in SQL-like language similar to in-memory SQLite database supports NumPy's vectorized functions basically a glorified NumPy array with column names More on reddit.com
🌐 r/AskProgramming
24
5
October 10, 2021
🌐
SciPython
scipython.com › books › book2 › chapter-6-numpy › questions › npndarray-and-nparray
Q6.1.1: np.ndarray and np.array
What is the difference between the objects np.ndarray and np.array? ... An np.ndarray is a NumPy class for representing multidimensional arrays in Python; we often refer to instances of this class simply as array objects.
🌐
Codemia
codemia.io › home › knowledge hub › what is the difference between ndarray and array in numpy?
What is the difference between ndarray and array in NumPy? | Codemia
September 23, 2025 - These are different types with different goals. The standard-library array.array is a compact one-dimensional container. NumPy's ndarray supports multidimensional data and numerical operations that the standard library type does not.
🌐
Planet of Bits
planetofbits.com › home › difference between ndarray and array in numpy
Difference between ndarray and array in numpy - Planet of Bits
July 24, 2018 - numpy.array() is just a method which returns an array object of the type ndarray. Since the name of the method is array, developers who are new to Python often tend to confuse that numpy.array returns an array object of some “array” type.
🌐
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.
🌐
Medium
vandroidsri.medium.com › arrays-vs-numpy-arrays-vs-list-9ca70bfb0212
Arrays vs NumPy Arrays vs List. On learning NumPy lots of confusion… | by Vandana Srivastava | Medium
July 22, 2024 - Let’s check the difference between array, ndarray and list, shown below ... NumPy Array: Best for numerical and scientific computing, supports advanced mathematical operations, and is highly efficient.
Find elsewhere
🌐
Oreate AI
oreateai.com › blog › understanding-the-nuances-numpy-array-vs-numpy-ndarray › 31fda2fde3ffece9d19bde81ed033ca7
Understanding the Nuances: Numpy Array vs. Numpy Ndarray - Oreate AI Blog
January 15, 2026 - The term ‘numpy array’ is generally used in a more casual context to refer to any array-like structure created using NumPy functions. It’s an umbrella term that encompasses various types of arrays within the library. However, when we delve into specifics, ‘ndarray’ (short for n-dimensional array) refers to a specific class provided by NumPy—essentially the core object upon which all other functionalities are built.
🌐
Towards Data Science
towardsdatascience.com › home › latest › 6 key differences between np.ndarray and np.matrix objects
6 Key differences between np.ndarray and np.matrix objects | Towards Data Science
January 22, 2025 - If you need to work on multi-dimensional arrays, you should use the ndarray objects as they are multi-dimensional. Numpy documentation recommends you using ndarray objects instead of matrix objects.
🌐
Iditect
iditect.com › faq › python › what-is-the-difference-between-ndarray-and-array-in-numpy.html
What is the difference between ndarray and array in NumPy?
In NumPy, both ndarray (short for "n-dimensional array") and array are used to represent arrays, but they are essentially the same thing. The term array is commonly used to refer to NumPy arrays, and ndarray is just an alias for array.
Top answer
1 of 4
8

NumPy and Python arrays share the property of being efficiently stored in memory.

NumPy arrays can be added together, multiplied by a number, you can calculate, say, the sine of all their values in one function call, etc. As HYRY pointed out, they can also have more than one dimension. You cannot do this with Python arrays.

On the other hand, Python arrays can indeed be appended to. Note that NumPy arrays can however be concatenated together (hstack(), vstack(),…). That said, NumPy arrays are mostly meant to have a fixed number of elements.

It is common to first build a list (or a Python array) of values iteratively and then convert it to a NumPy array (with numpy.array(), or, more efficiently, with numpy.frombuffer(), as HYRY mentioned): this allows mathematical operations on arrays (or matrices) to be performed very conveniently (simple syntax for complex operations). Alternatively, numpy.fromiter() might be used to construct the array from an iterator. Or loadtxt() to construct it from a text file.

2 of 4
7

There are at least two main reasons for using NumPy arrays:

  • NumPy arrays require less space than Python lists. So you can deal with more data in a NumPy array (in-memory) than you can with Python lists.
  • NumPy arrays have a vast library of functions and methods unavailable to Python lists or Python arrays.

Yes, you can not simply convert lists to NumPy arrays and expect your code to continue to work. The methods are different, the bool semantics are different. For the best performance, even the algorithm may need to change.

However, if you are looking for a Python replacement for Matlab, you will definitely find uses for NumPy. It is worth learning.

🌐
NumPy
numpy.org › doc › 2.5 › 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 › difference-between-numpy-array-and-numpy-matrix
Difference between Numpy array and Numpy matrix - GeeksforGeeks
July 23, 2025 - The Numpy array object in Numpy is called ndarray. We can create ndarray using numpy.array() function. It is used to convert a list, tuple, etc.
🌐
pythontutorials
pythontutorials.net › blog › what-is-the-difference-between-ndarray-and-array-in-numpy
NumPy ndarray vs array: What's the Difference? Plus Source Code Implementation — pythontutorials.net
NumPy (Numerical Python) is a foundational library for scientific computing in Python, and its core data structure is the ndarray (N-dimensional array). An ndarray is a multi-dimensional container for homogeneous data (all elements must be of ...
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.ndarray.html
numpy.ndarray — NumPy v2.5 Manual
Arrays should be constructed using array, zeros or empty (refer to the See Also section below). The parameters given here refer to a low-level method (ndarray(…)) for instantiating an array. For more information, refer to the numpy module and examine the methods and attributes of an array.
🌐
NumPy
numpy.org › doc › 2.1 › reference › arrays.html
Array objects — NumPy v2.1 Manual
NumPy provides an N-dimensional array type, the ndarray, which describes a collection of “items” of the same type.
🌐
NumPy
numpy.org › doc › stable › reference › arrays.html
Array objects — NumPy v2.5 Manual
NumPy provides an N-dimensional array type, the ndarray, which describes a collection of “items” of the same type.
🌐
NumPy
numpy.org › doc › 2.1 › reference › arrays.ndarray.html
The N-dimensional array (ndarray) — NumPy v2.1 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 › difference-between-np-asarray-and-np-array
Difference between np.asarray() and np.array()? - GeeksforGeeks
July 23, 2025 - The np.array() in Python is used to convert a list, tuple, etc. into a Numpy array. ... Return : [ndarray] Array interpretation of arr.
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