You are performing two completely different operations here so you cannot directly compare: multiplying a list by 2 will create a new list where the list is concatenated to itself (so the length of the output list is twice that of the input list), whereas multiplying a numpy array by 2 will create a new array of the same length as the original array, but in which each element has been multiplied by 2.

Nonetheless, if you had attempted to perform a list operation which actually corresponds to the numpy case (element-by-element multiplication), for example:

my_list2 = [n * 2 for n in my_listy]

you would also have found that the numpy example was quicker. This is because the required looping in numpy is performed in a shared library consisting of compiled C code, rather than using an explicit loop in Python (for loop or list comprehension).

$ python -mtimeit -s 'import numpy as np; my_array = np.array(range(1000000))' 'my_array2 = my_array * 2'
1000 loops, best of 3: 1.45 msec per loop

$ python -mtimeit -s 'my_listy = list(range(1000000))' 'my_list2 = [n*2 for n in my_listy]'
10 loops, best of 3: 50.8 msec per loop
Answer from alani on Stack Overflow
🌐
Reddit
reddit.com › r/numpy › why is numpy much faster than lists?
r/Numpy on Reddit: Why is NumPy Much Faster Than Lists?
May 23, 2024 -

Why is NumPy Faster Than Lists?

w3schools says

NumPy arrays are stored at one continuous place in memory unlike lists, so processes can access and manipulate them very efficiently. This behavior is called locality of reference in computer science. This is the main reason why NumPy is faster than lists.

That line seems to suggest List elements are not stored contiguously, which contrasts with my understanding that array data structures in all languages are designed to occupy a contiguous block of memory, as described in this Python book.

Top answer
1 of 2
2

You are performing two completely different operations here so you cannot directly compare: multiplying a list by 2 will create a new list where the list is concatenated to itself (so the length of the output list is twice that of the input list), whereas multiplying a numpy array by 2 will create a new array of the same length as the original array, but in which each element has been multiplied by 2.

Nonetheless, if you had attempted to perform a list operation which actually corresponds to the numpy case (element-by-element multiplication), for example:

my_list2 = [n * 2 for n in my_listy]

you would also have found that the numpy example was quicker. This is because the required looping in numpy is performed in a shared library consisting of compiled C code, rather than using an explicit loop in Python (for loop or list comprehension).

$ python -mtimeit -s 'import numpy as np; my_array = np.array(range(1000000))' 'my_array2 = my_array * 2'
1000 loops, best of 3: 1.45 msec per loop

$ python -mtimeit -s 'my_listy = list(range(1000000))' 'my_list2 = [n*2 for n in my_listy]'
10 loops, best of 3: 50.8 msec per loop
2 of 2
0

The following are the main reasons behind the fast speed of Numpy.
-Numpy array is a collection of similar data-types that are densely packed in memory. A Python list can have different data-types, which puts lots of extra constraints while doing computation on it.
-Numpy is able to divide a task into multiple subtasks and process them parallelly.
-Numpy functions are implemented in C. Which again makes it faster compared to Python Lists.

Python at first was not made for numeric operations but with time numpy was created for this scope(making python better at numeric operations). Source: towardsdatascience.com

🌐
GeeksforGeeks
geeksforgeeks.org › python › why-numpy-is-faster-in-python
Why is Numpy faster in Python? - GeeksforGeeks
August 13, 2021 - Concatenation: Time taken by Lists : 0.02946329116821289 seconds Time taken by NumPy Arrays : 0.011709213256835938 seconds Dot Product: Time taken by Lists : 0.179551362991333 seconds Time taken by NumPy Arrays : 0.004144191741943359 seconds Scalar Addition: Time taken by Lists : 0.09385180473327637 seconds Time taken by NumPy Arrays : 0.005884408950805664 seconds Deletion: Time taken by Lists : 0.01268625259399414 seconds Time taken by NumPy Arrays : 3.814697265625e-06 seconds · From the above program, we conclude that operations on NumPy arrays are executed faster than Python lists.
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.

🌐
Medium
medium.com › @sujathamudadla1213 › why-is-numpy-faster-and-more-efficient-than-python-lists-for-numerical-computations-9fadb3f663f4
Why is NumPy faster and more efficient than Python lists for numerical computations? | by Sujatha Mudadla | Medium
January 2, 2025 - This leverages compiled C code under the hood, making computations much faster. Efficient Memory Usage: NumPy arrays are more memory-efficient than lists because they store elements of the same data type in contiguous memory locations.
🌐
Medium
medium.com › @yuxuzi › frequent-interview-question-why-is-numpy-faster-than-python-lists-06df9c6cd3bb
Mastering NumPy — Episode 1: Why is NumPy Faster Than Python Lists? | by Leo Liu | Medium
January 16, 2024 - 2. Efficient Memory Utilization: The data structures in NumPy consume less space. Thanks to the array’s homogeneity and other internal optimizations, memory usage is minimized. 3. C Library Underpinnings: NumPy is built on C, which allows ...
Find elsewhere
🌐
Quora
quora.com › Are-NumPy-arrays-faster-than-lists
Are NumPy arrays faster than lists? - Quora
Answer (1 of 5): Doing which operations ? Remember that numpy is optimised for certain operations, where as lists are generic. When numpy sees an array it know exactly what it contains (integers or floats - actual values stored in memory), and what size the array is.. When Python sees a list i...
🌐
Medium
medium.com › swlh › numpy-why-is-it-so-fast-8087f4da4d79
NumPy — Why is it so fast?
June 8, 2020 - Whereas NumPy itself is written in C, which is the main result of its faster execution time. Apart from being written in C, its memory allocation is far better than that of a normal list in python.
🌐
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 - On running this, you would find that the Python list takes up significantly more memory than the Numpy array. ... Now let’s move on to the speed of computation. Because Numpy uses contiguous blocks of memory, it can take advantage of vectorized operations, which are processed by your computer’s SIMD (Single Instruction, Multiple Data) capabilities. This results in faster computations.
🌐
Medium
medium.com › @devipriyadasari07 › why-numpy-arrays-are-so-much-faster-than-python-lists-534dd2982a3c
Why NumPy Arrays Are So Much Faster Than Python Lists ? | by Devi Priya Dasari | Medium
July 17, 2025 - NumPy arrays are significantly faster than Python lists for numerical computations due to several factors: Homogeneous Data Types: NumPy arrays store elements of the same data type, allowing for more efficient storage and access.
🌐
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.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-lists-vs-numpy-arrays
Python Lists VS Numpy Arrays - GeeksforGeeks
Performance: NumPy arrays are optimized for numerical computations, with efficient element-wise operations and mathematical functions. These operations are implemented in C, resulting in faster performance than equivalent operations on lists.
Published: July 12, 2025
🌐
Medium
medium.com › @gough.cory › performance-of-numpy-array-vs-python-list-194c8e283b65
Performance of Numpy Array vs Python List | by Cory Gough | Medium
August 21, 2019 - The following graph plots the performance of taking two random arrays/lists and adding them together. We can clearly see that this operation in numpy is practically the same for 100 elements and 10,000,000 elements. While python grows at a at fast rate!
🌐
Stackademic
blog.stackademic.com › exploring-numpy-features-performance-vs-lists-7f0b43d2af5f
Exploring NumPy: Features & Performance Vs Lists | by Ayman Hamed | Stackademic
August 30, 2023 - Purpose: Vectorization allows for the execution of operations on entire arrays, eliminating the need for explicit loops. Mechanism: It takes advantage of the architecture of modern CPUs and other hardware capabilities, making calculations significantly faster than traditional Python loops. Use Cases: Almost all NumPy operations are inherently vectorized.
🌐
Bhavesh Bhatt
bhattbhavesh91.github.io › numpy-speed
How NumPy Arrays are faster than Python List? - Bhavesh Bhatt
August 24, 2019 - Numpy is the core library for scientific computing in Python. A NumPy array is a grid of values, all of the same type, and is indexed by a tuple of non-negative integers. The Python core library provided Lists. A list is the Python equivalent of an array, but is resizeable and can contain elements of different types.
🌐
Medium
medium.com › @kvanudeep144 › numpy-array-vs-python-list-why-numpy-is-faster-and-more-memory-efficient-c33c90ab9b8f
NumPy Array vs Python List: Why NumPy is Faster and More Memory Efficient | by Kommaraju veda anudeep | Medium
July 17, 2025 - Python lists store items scattered in memory. Every time you access something, Python has to jump around in memory. NumPy arrays, however, store everything in one continuous block, making it much faster to process.
🌐
The Neural Base
theneuralbase.com › home › numpy for ml › beginner course › why numpy is faster than pure python lists
Why NumPy is faster than pure Python lists | Numpy For Ml Beginner Course | The Neural Base
NumPy arrays are dramatically faster than Python lists because they store homogeneous data contiguously in memory and delegate computation to optimized C code.