NumPy's arrays are more compact than Python lists -- a list of lists as you describe, in Python, would take at least 20 MB or so, while a NumPy 3D array with single-precision floats in the cells would fit in 4 MB. Access in reading and writing items is also faster with NumPy.

Maybe you don't care that much for just a million cells, but you definitely would for a billion cells -- neither approach would fit in a 32-bit architecture, but with 64-bit builds NumPy would get away with 4 GB or so, Python alone would need at least about 12 GB (lots of pointers which double in size) -- a much costlier piece of hardware!

The difference is mostly due to "indirectness" -- a Python list is an array of pointers to Python objects, at least 4 bytes per pointer plus 16 bytes for even the smallest Python object (4 for type pointer, 4 for reference count, 4 for value -- and the memory allocators rounds up to 16). A NumPy array is an array of uniform values -- single-precision numbers takes 4 bytes each, double-precision ones, 8 bytes. Less flexible, but you pay substantially for the flexibility of standard Python lists!

Answer from Alex Martelli on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-lists-vs-numpy-arrays
Python Lists VS Numpy Arrays - GeeksforGeeks
Functionality: Lists can store any data type, but lack specialized NumPy functions for numerical operations. Homogeneous Data: NumPy arrays store elements of the same data type, making them more compact and memory-efficient than lists.
Published: July 12, 2025
Top answer
1 of 8
838

NumPy's arrays are more compact than Python lists -- a list of lists as you describe, in Python, would take at least 20 MB or so, while a NumPy 3D array with single-precision floats in the cells would fit in 4 MB. Access in reading and writing items is also faster with NumPy.

Maybe you don't care that much for just a million cells, but you definitely would for a billion cells -- neither approach would fit in a 32-bit architecture, but with 64-bit builds NumPy would get away with 4 GB or so, Python alone would need at least about 12 GB (lots of pointers which double in size) -- a much costlier piece of hardware!

The difference is mostly due to "indirectness" -- a Python list is an array of pointers to Python objects, at least 4 bytes per pointer plus 16 bytes for even the smallest Python object (4 for type pointer, 4 for reference count, 4 for value -- and the memory allocators rounds up to 16). A NumPy array is an array of uniform values -- single-precision numbers takes 4 bytes each, double-precision ones, 8 bytes. Less flexible, but you pay substantially for the flexibility of standard Python lists!

2 of 8
270

NumPy is not just more efficient; it is also more convenient. You get a lot of vector and matrix operations for free, which sometimes allow one to avoid unnecessary work. And they are also efficiently implemented.

For example, you could read your cube directly from a file into an array:

x = numpy.fromfile(file=open("data"), dtype=float).reshape((100, 100, 100))

Sum along the second dimension:

s = x.sum(axis=1)

Find which cells are above a threshold:

(x > 0.5).nonzero()

Remove every even-indexed slice along the third dimension:

x[:, :, ::2]

Also, many useful libraries work with NumPy arrays. For example, statistical analysis and visualization libraries.

Even if you don't have performance problems, learning NumPy is worth the effort.

Discussions

Python numpy array vs list - Stack Overflow
I need to perform some calculations a large list of numbers. Do array.array or numpy.array offer significant performance boost over typical arrays? I don't have to do complicated manipulations on... More on stackoverflow.com
🌐 stackoverflow.com
Is it ever advantageous to use a standard Python list vs a numpy array when all elements are the same type?
very often it is more efficient to use a list of numpy arrays than a higher dimensional (3D, 4D, ...) array. E.g., if you are computing polynomials, storing the terms in a list of arrays will be approximately sqrt(n_terms) faster than an nd array with the term # on the first dimension. The numpy allocator is relatively better at many small arrays than it is a few jumbo ones. More on reddit.com
🌐 r/Python
13
4
December 8, 2020
Numpy array vs list
I can't figure out what the difference is between a Numpy array and a normal list. More on reddit.com
🌐 r/Python
8
0
November 3, 2017
Why is NumPy Much Faster Than Lists?
List are a contiguous array of PyObjects each of which points to the underlying data. A NumPy array is a contiguous array of the data itself. So NumPy doesn’t have to chase pointers to get to the actual data. Take a look at this page for more details: https://jakevdp.github.io/PythonDataScienceHandbook/02.01-understanding-data-types.html More on reddit.com
🌐 r/Numpy
5
3
May 23, 2024
🌐
Reddit
reddit.com › r/python › is it ever advantageous to use a standard python list vs a numpy array when all elements are the same type?
r/Python on Reddit: Is it ever advantageous to use a standard Python list vs a numpy array when all elements are the same type?
December 8, 2020 -

I'm wondering if there is a use case where lists are better than numpy arrays besides storing multiple types of data in a relatively small/low dimension list (say i just want a quick-and-dirty list to store some constants i want to call on later?

I'm not well versed enough in how processors/memory work to know if I'm missing something else obvious. I know it won't make a huge performance impact anyways if you don't actually have a lot of math or large lists/arrays to work with, but I've been diving deeper into how numpy/pandas function at a basic level and it got me thinking about this.

🌐
TechVidvan
techvidvan.com › tutorials › python-lists-vs-numpy-arrays
Python Lists VS Numpy Arrays - TechVidvan
October 24, 2024 - The homogeneous composition of NumPy arrays ensures that all their components possess a uniform data type, rendering them ideally suited for numerical calculations. Furthermore, they support operations performed at an individual element level and offer an extensive array of functions, methods, and variables tailored specifically for matrix computations. They also facilitate stored data contiguously in memory, thereby enhancing the pace of data access. Conversely, Python Lists offer dynamism and adaptability similar to arrays that dynamically expand in other programming languages.
🌐
Enki
enki.com › post › lists-vs-arrays-in-python
Enki | Blog - Lists vs Arrays in Python
Lists are quick with appending or popping elements at the end. However, inserting or deleting elements from elsewhere involves shifting, which can be slow. NumPy arrays are tailored for numerical operations.
🌐
Towards Data Science
towardsdatascience.com › home › latest › python lists vs. numpy arrays: a deep dive into memory layout and performance benefits
Python Lists Vs. NumPy Arrays: A Deep Dive into Memory Layout and Performance Benefits | Towards Data Science
March 5, 2025 - Since the items are all grouped by category, you can quickly find a book without having to search through many boxes. This is why NumPy arrays are faster than native Python lists in many operations.
🌐
Data Leads Future
dataleadsfuture.com › python-lists-vs-numpy-arrays-a-deep-dive-into-memory-layout-and-performance-benefits
Python Lists Vs. NumPy Arrays: A Deep Dive into Memory Layout and Performance Benefits
December 19, 2025 - Since the items are all grouped by category, you can quickly find a book without having to search through many boxes. This is why NumPy arrays are faster than native Python lists in many operations.
Find elsewhere
🌐
LearnPython.com
learnpython.com › blog › python-array-vs-list
Array vs. List in Python – What's the Difference? | LearnPython.com
If you need to store a relatively short sequence of items and you don't plan to do any mathematical operations with it, a list is the preferred choice. This data structure will allow you to store an ordered, mutable, and indexed sequence of ...
Top answer
1 of 7
15

You first need to understand the difference between arrays and lists.

An array is a contiguous block of memory consisting of elements of some type (e.g. integers).

You cannot change the size of an array once it is created.
It therefore follows that each integer element in an array has a fixed size, e.g. 4 bytes.

On the other hand, a list is merely an "array" of addresses (which also have a fixed size).

But then each element holds the address of something else in memory, which is the actual integer that you want to work with. Of course, the size of this integer is irrelevant to the size of the array. Thus you can always create a new (bigger) integer and "replace" the old one without affecting the size of the array, which merely holds the address of an integer.

Of course, this convenience of a list comes at a cost: Performing arithmetic on the integers now requires a memory access to the array, plus a memory access to the integer itself, plus the time it takes to allocate more memory (if needed), plus the time required to delete the old integer (if needed). So yes, it can be slower, so you have to be careful what you're doing with each integer inside an array.

2 of 7
9

Your first example could be speed up. Python loop and access to individual items in a numpy array are slow. Use vectorized operations instead:

import numpy as np
x = np.arange(1000000).cumsum()

You can put unbounded Python integers to numpy array:

a = np.array([0], dtype=object)
a[0] += 1232234234234324353453453

Arithmetic operations compared to fixed-sized C integers would be slower in this case.

🌐
Note.nkmk.me
note.nkmk.me › home › python
List vs. Array vs. numpy.ndarray in Python | note.nkmk.me
February 5, 2024 - Although array provides strict memory management by restricting elements to a single type, list is often preferred for general-purpose applications without specific memory constraints.
🌐
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.
🌐
Dataquest
support.dataquest.io › en › articles › 811-stop-using-python-lists-and-start-using-these-instead
Stop Using Python Lists and Start Using These Instead
May 19, 2026 - NumPy arrays offer a faster, more efficient alternative to Python lists, thanks to their streamlined design and powerful vectorization capabilities. Whether you're crunching numbers or analyzing massive datasets, NumPy can save you time and hassle.
🌐
LinkedIn
linkedin.com › pulse › python-lists-vs-numpy-arrays-mohamed-hamdy-b5e9f
Python Lists vs NumPy Arrays
Login to LinkedIn to keep in touch with people you know, share ideas, and build your career.
🌐
Medium
medium.com › @vakgul › numpy-vs-traditional-python-lists-a-performance-showdown-1e8bebc55933
Numpy vs Traditional Python Lists: A Performance Showdown | by veyak | Medium
June 13, 2023 - These examples demonstrate the power of Numpy arrays in terms of memory efficiency and computation speed. While Python’s built-in lists are great for a variety of tasks, when it comes to numerical computation on large datasets, Numpy reigns supreme.
🌐
datagy
datagy.io › home › python posts › python lists › difference between array and list in python
Difference Between Array and List in Python • datagy
December 30, 2022 - The NumPy array is commonly used for numerical calculations. However, it’s much more akin to the Python list. In fact, it carries all of the same properties of a Python list (including storing different data types).
🌐
Plain English
plainenglish.io › home › blog › python › difference between python list and numpy array
Difference Between Python List and NumPy Array
July 11, 2021 - See how using a * (multiply) in a list returns a repeated data in the list (while we meant to multiply all of the data in the list) and where using it on an array gives a correct or desired result. This is why if you're dealing with lots of mathematical operations for your data, you should use an array. Although, you can also use a function in numpy to do a mathematical function to your list.
🌐
Sololearn
sololearn.com › en › Discuss › 1909157 › what-the-difference-between-python-lists-and-numpy-arrays
What the difference between Python lists and NumPy arrays? | Sololearn: Learn to code for FREE!
Numpy elements have to be the same type; Due fact that Numpy is written in.C, there are significant difference in code execusion. Numpy arrays are simply much faster than typical Python lists when you operate on them
🌐
Medium
medium.com › @jennycoreholt › what-is-the-difference-between-python-lists-and-numpy-arrays-5e214f2966a6
What is the Difference Between Python Lists and NumPy Arrays? | by Jenny Core-Holt | Medium
June 7, 2025 - Lists are flexible and general-purpose but not optimised for numerical operations. NumPy arrays are designed for efficient mathematical computation and data analysis, with extra capabilities like .shape, slicing, and broadcasting.
🌐
Medium
medium.com › @abhinava808 › python-lists-vs-numpy-arrays-why-speed-and-memory-matter-in-data-science-06bc64752b7a
Python Lists vs. NumPy Arrays: Why Speed (and Memory) Matter in Data Science | by Abhinav Kumar N A | Medium
June 9, 2025 - Python Lists vs. NumPy Arrays: Why Speed (and Memory) Matter in Data Science TL;DR: Python lists are flexible but slow for numerical tasks. NumPy arrays are faster, more memory-efficient and built