๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-lists-vs-numpy-arrays
Python Lists VS Numpy Arrays - GeeksforGeeks
Numpy arrays facilitate advanced mathematical and other types of operations on large numbers of data. Typically, such operations are executed more efficiently and with less code than is possible using Python's built-in sequences.
Published: July 12, 2025
๐ŸŒ
New York University
physics.nyu.edu โ€บ pine โ€บ pymanual โ€บ html โ€บ chap3 โ€บ chap3_arrays.html
3. Strings, Lists, Arrays, and Dictionaries โ€” PyMan 0.9.31 documentation
NumPy arrays are used to store lists of numerical data and to represent vectors, matrices, and even tensors. NumPy arrays are designed to handle large data sets efficiently and with a minimum of fuss. The NumPy library has a large set of routines for creating, manipulating, and transforming ...
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ 2.1 โ€บ reference โ€บ generated โ€บ numpy.ndarray.tolist.html
numpy.ndarray.tolist โ€” NumPy v2.1 Manual
Return a copy of the array data as a (nested) Python list. Data items are converted to the nearest compatible builtin Python type, via the item function.
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ stable โ€บ reference โ€บ generated โ€บ numpy.ndarray.tolist.html
numpy.ndarray.tolist โ€” NumPy v2.5 Manual
Return a copy of the array data as a (nested) Python list. Data items are converted to the nearest compatible builtin Python type, via the item method.
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ 2.4 โ€บ reference โ€บ generated โ€บ numpy.ndarray.tolist.html
numpy.ndarray.tolist โ€” NumPy v2.4 Manual
Return a copy of the array data as a (nested) Python list. Data items are converted to the nearest compatible builtin Python type, via the item method.
๐ŸŒ
The Python Coding Stack
thepythoncodingstack.com โ€บ the python coding stack โ€บ why can't i just use a list? โ€ข understanding numpy's `ndarray` (a numpy for numpties article)
Why Can't I Just Use A List? โ€ข Understanding NumPy's `ndarray` (A NumPy for Numpties article)
June 25, 2024 - But, the main benefits of having an iterable can often be replaced with another feature unique to NumPy arrays. We'll explore this in the next section. This will be a topic for a future Numpy for Numpties article, but I'll write a short preview here. Let's start with a demo example. You have a list of numbers, and you want to multiply each one by 3: This won't work. Multiplying the whole list by 3 repeats the list three times. It doesn't multiply each element of the list by 3.
๐ŸŒ
Dsc10
notes.dsc10.com โ€บ 02-data_sets โ€บ arrays.html
7. Lists and NumPy Arrays โ€” Notes on (Baby)Pandas
It should also be noted that the same syntax works for retrieving elements from Python lists: ... When working with a data set we often want to perform the same operation on all of the data setโ€™s elements at once. For example, given an array of temperatures in Fahrenheit, we might want to convert all of them to Celsius. Because of this, Numpy makes writing code that works with
๐ŸŒ
Hpc-carpentry
hpc-carpentry.org โ€บ hpc-python โ€บ 03-lists โ€บ index.html
Numpy arrays and lists โ€“ Introduction to High-Performance Computing in Python
January 20, 2023 - A numpy array is a collection of numbers that can have any number of dimensions. In this case, there is only one dimension, since we created the array from a list. import numpy as np new_vals = np.array(vals) new_vals += 10 new_vals[:5] ... One very nice thing about Numpy is that itโ€™s much ...
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ stable โ€บ reference โ€บ generated โ€บ numpy.array.html
numpy.array โ€” NumPy v2.5 Manual
In this case, it ensures the creation of an array object compatible with that passed in via this argument.
Find elsewhere
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ convert-python-list-to-numpy-arrays
Convert Python List to numpy Arrays - GeeksforGeeks
July 12, 2025 - The numpy.array() function is the most common way to convert a list into an array. It takes the Python list as an argument and returns a NumPy array containing the same elements.
๐ŸŒ
NumPy
numpy.org โ€บ devdocs โ€บ reference โ€บ generated โ€บ numpy.ndarray.tolist.html
numpy.ndarray.tolist โ€” NumPy v2.6.dev0 Manual
Return a copy of the array data as a (nested) Python list. Data items are converted to the nearest compatible builtin Python type, via the item method.
๐ŸŒ
APXML
apxml.com โ€บ courses โ€บ essential-numpy-pandas โ€บ chapter-2-getting-started-numpy-arrays โ€บ creating-arrays-from-lists
NumPy Array from Python List
While NumPy offers specialized functions for creating arrays (which we'll see shortly), a very common starting point is to convert existing Python data structures, particularly lists, into NumPy arrays. This is often the first step when you have data already loaded or generated using standard Python code. The primary function for this conversion is np.array(). Let's see how it works.
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ 2.2 โ€บ reference โ€บ generated โ€บ numpy.ndarray.tolist.html
numpy.ndarray.tolist โ€” NumPy v2.2 Manual
Return a copy of the array data as a (nested) Python list. Data items are converted to the nearest compatible builtin Python type, via the item function.
๐ŸŒ
Analytics Vidhya
analyticsvidhya.com โ€บ home โ€บ how to convert python list to numpy arrays?
How to Convert Python List to NumPy Arrays? - Analytics Vidhya
April 21, 2025 - What does a NumPy array list do? A. A NumPy array is an efficient data structure for storing and manipulating numerical data in fixed-size, multi-dimensional arrays. It supports vectorized operations and broadcasting, which simplifies and ...
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ stable โ€บ user โ€บ absolute_beginners.html
NumPy: the absolute basics for beginners โ€” NumPy v2.5 Manual
Another difference between an array and a list of lists is that an element of the array can be accessed by specifying the index along each axis within a single set of square brackets, separated by commas. For instance, the element 8 is in row 1 and column 3: ... It is familiar practice in mathematics to refer to elements of a matrix by the row index first and the column index second.
๐ŸŒ
DataCamp
datacamp.com โ€บ doc โ€บ numpy โ€บ array
NumPy array()
It allows for efficient storage and manipulation of numerical data, making it essential for scientific and mathematical computing. The np.array() function is used to convert Python lists, tuples, other array-like objects such as existing NumPy arrays, or any similar structures into NumPy arrays.
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ numpy โ€บ numpy_intro.asp
Introduction to NumPy
NumPy aims to provide an array object that is up to 50x faster than traditional Python lists. The array object in NumPy is called ndarray, it provides a lot of supporting functions that make working with ndarray very easy.
๐ŸŒ
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.
๐ŸŒ
Built In
builtin.com โ€บ data-science โ€บ how-to-create-list-array-python
How to Create Python Lists & NumPy Arrays | Built In
The main difference is that NumPy arrays are much faster and have strict requirements on the homogeneity of the objects. For example, a NumPy array of strings can only contain strings and no other data types, but a Python list can contain a mixture of strings, numbers, booleans and other objects.
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.