Basically, Python lists are very flexible and can hold completely heterogeneous, arbitrary data, and they can be appended to very efficiently, in amortized constant time. If you need to shrink and grow your list time-efficiently and without hassle, they are the way to go. But they use a lot more space than C arrays, in part because each item in the list requires the construction of an individual Python object, even for data that could be represented with simple C types (e.g. float or uint64_t).

The array.array type, on the other hand, is just a thin wrapper on C arrays. It can hold only homogeneous data (that is to say, all of the same type) and so it uses only sizeof(one object) * length bytes of memory. Mostly, you should use it when you need to expose a C array to an extension or a system call (for example, ioctl or fctnl).

array.array is also a reasonable way to represent a mutable string in Python 2.x (array('B', bytes)). However, Python 2.6+ and 3.x offer a mutable byte string as bytearray.

However, if you want to do math on a homogeneous array of numeric data, then you're much better off using NumPy, which can automatically vectorize operations on complex multi-dimensional arrays.

To make a long story short: array.array is useful when you need a homogeneous C array of data for reasons other than doing math.

Answer from Dan Lenski on Stack Overflow
Top answer
1 of 11
528

Basically, Python lists are very flexible and can hold completely heterogeneous, arbitrary data, and they can be appended to very efficiently, in amortized constant time. If you need to shrink and grow your list time-efficiently and without hassle, they are the way to go. But they use a lot more space than C arrays, in part because each item in the list requires the construction of an individual Python object, even for data that could be represented with simple C types (e.g. float or uint64_t).

The array.array type, on the other hand, is just a thin wrapper on C arrays. It can hold only homogeneous data (that is to say, all of the same type) and so it uses only sizeof(one object) * length bytes of memory. Mostly, you should use it when you need to expose a C array to an extension or a system call (for example, ioctl or fctnl).

array.array is also a reasonable way to represent a mutable string in Python 2.x (array('B', bytes)). However, Python 2.6+ and 3.x offer a mutable byte string as bytearray.

However, if you want to do math on a homogeneous array of numeric data, then you're much better off using NumPy, which can automatically vectorize operations on complex multi-dimensional arrays.

To make a long story short: array.array is useful when you need a homogeneous C array of data for reasons other than doing math.

2 of 11
78

For almost all cases the normal list is the right choice. The arrays module is more like a thin wrapper over C arrays, which give you kind of strongly typed containers (see docs), with access to more C-like types such as signed/unsigned short or double, which are not part of the built-in types. I'd say use the arrays module only if you really need it, in all other cases stick with lists.

🌐
LearnPython.com
learnpython.com › blog › python-array-vs-list
Array vs. List in Python – What's the Difference? | LearnPython.com
Python lists are used just about everywhere, as they are a great tool for saving a sequence of items and iterating over it. An array is also a data structure that stores a collection of items.
Discussions

What is the difference between an array and a list?
Hi I need to know the difference between an array and a list More on discuss.python.org
🌐 discuss.python.org
2
0
January 15, 2021
Are arrays and lists essentially the same?
“Array” is an ambiguous term in Python and best not used. Most beginners use it to refer to the list type, but are unaware that there is actually an array.array type in the standard library as well. More on reddit.com
🌐 r/learnpython
41
32
May 7, 2022
When to use array vs. list (vs dict)
If you're specifically dealing with matrices and need to perform maths on them, or have a specific use-case where the performance benefits would be needed, use Numpy arrays. Keep in mind that if you're constantly converting between lists and Numpy arrays that'll probably eat up any performance gains you got, so if you go this route do as much as you can with Numpy's own functionality. Otherwise, default to lists. There's technically also array.array in the standard library, but I say ignore it. You won't have a use for it unless you're specifically interfacing with C code. EDIT: And remember, your algorithm matters far more than the data structure. So don't treat Numpy as a silver bullet for performance gains. As for dictionaries, at some point you'll intuitively know when to use one, but if you want to map one set of values to another that's a pretty good candidate. More on reddit.com
🌐 r/learnpython
14
13
November 14, 2023
What is the difference between a Tuple, List, and Array? When and why to use each one.
Array: contiguous in memory (so each element is one after the other). fixed sized. very space efficient. very efficient to iterate over and access random elements. not efficient to insert something new in the middle of it, or to delete something. dynamic arrays (vectors, arraylist, etc) can be efficiently resized, and are the preferred data structure for lists unless you have a reason not to use them. (Linked) list: not continuous in memory. each node of the list contains data and a pointer/reference to the next element (and maybe a pointer to the previous). fairly efficient to iterate over. inefficient to access a random element, but efficient to access to first (and maybe last) element, efficient to add an element after (and maybe before) another, or remove an element. very efficient to merge and splice. tuple: completely different. tuples (or product types) do not represent a list of data. They are an object with a fixed dimension and each coordinate contains a particular type of data (in linked lists and arrays data is homogenous; in tuples it's often not). More on reddit.com
🌐 r/learnprogramming
8
2
August 17, 2015
People also ask

What is the difference between an array and an ArrayList?
While comparing array vs list, an array is fixed in size and holds data types that are similar in nature, whereas an ArrayList, which is common in the case of Java, can resize dynamically, like a list in Python example. In the case of array vs list Python, the list in Python acts in the same manner as an ArrayList by resizing dynamically.
🌐
jaroeducation.com
jaroeducation.com › home › blog › difference between arrays and list
Array vs List in Python: Differences, Uses & Examples
What are arrays in Python?
In Python, an array is a data structure that stores a list of elements of the same kind in a contiguous manner. For a comparison between array and list in terms of their usage, an array in Python is used when a mathematical operation has to be performed.
🌐
jaroeducation.com
jaroeducation.com › home › blog › difference between arrays and list
Array vs List in Python: Differences, Uses & Examples
What is the difference between array and list in Python?
The primary difference between array and list in Python is that the elements in the array are of the same data type, but in the case of a list, the data types can be different. Arrays in the context of array vs list in Python are more memory-efficient than lists.
🌐
jaroeducation.com
jaroeducation.com › home › blog › difference between arrays and list
Array vs List in Python: Differences, Uses & Examples
🌐
GeeksforGeeks
geeksforgeeks.org › python › difference-between-list-and-array-in-python
Difference between List and Array in Python - GeeksforGeeks
January 14, 2026 - The first element of the list is an integer, the second is a Python string and the third is a list of characters. ... An array is a data structure that stores elements of the same data type in contiguous memory locations, making it efficient ...
🌐
Jaro Education
jaroeducation.com › home › blog › difference between arrays and list
Array vs List in Python: Differences, Uses & Examples
4 days ago - While comparing array vs list, an array is fixed in size and holds data types that are similar in nature, whereas an ArrayList, which is common in the case of Java, can resize dynamically, like a list in Python example.
Find elsewhere
🌐
FavTutor
favtutor.com › blogs › python-array-vs-list
Array vs List in Python | 6 Main Differences
January 2, 2024 - While arrays are fixed in terms of dimension and can only carry homogeneous data, lists are changing and can hold any sort of object. A Python list can expand or contract according to requirements by allocating as well as deallocating memory ...
🌐
Codedamn
codedamn.com › news › python
What is the difference between an array and a list in Python?
November 7, 2022 - Lists and arrays store a collection of items. They have multiple use cases and could easily work with other modules and libraries for better outcomes. They both belong to the sequence data types in Python. Easiest to initialize compared to all other programming languages.
🌐
Vertabelo
academy.vertabelo.com › blog › python-array-vs-list
Vertabelo Academy Blog | Array vs. List in Python – What's the Difference?
December 17, 2019 - Python lists are used just about everywhere, as they are a great tool for saving a sequence of items and iterating over it. An array is also a data structure that stores a collection of items.
🌐
Javatpoint
javatpoint.com › python-array-vs-list
Python Array vs. List - Javatpoint
Python Array vs. List with python, tutorial, tkinter, button, overview, entry, checkbutton, canvas, frame, environment set-up, first python program, operators, etc.
🌐
Upgrad
upgrad.com › home › blog › data science › difference between array and list in python: key uses & benefits
Difference Between Array and List: Python's Data Duel
July 7, 2026 - Python list is a highly flexible, built-in data structure that can hold items of different data types. An · array, on the other hand, requires all its elements to be of the same data type.
🌐
Vista Academy
thevistaacademy.com › home › blog › python array vs list: key differences and when to use each [2025 updated]
Python Array vs List: Key Differences and When to Use Each [2025 Updated]
August 21, 2025 - Array: Large numeric data, ML/DS pipelines, matrix ops. List: General Python tasks, mixed records, quick prototyping.
🌐
Scaler
scaler.com › home › topics › what is the difference between array and list in python?
What is the Difference Between Array and List in Python? - Scaler Topics
March 31, 2024 - We can only store elements of the same types in the array. Lists are the inbuilt data structure of python.
🌐
Cisco
ipcisco.com › home › python array vs list
Python Array vs List ⋆ | Similarities & Differences | Python Coding
March 5, 2026 - List are good for shorter sequence of data. But arrays are better for longer sequence of data. Here, we have talked about the similarities and the differences of python arrays and python lists we have compared Python array vs List.
🌐
AskPython
askpython.com › python › difference-between-python-list-vs-array
Python List vs Array - 4 Differences to know! - AskPython
July 24, 2020 - The main difference between a Python list and a Python array is that a list is part of the Python standard package whereas, for an array, the “array” module needs to be imported.
🌐
Krayonnz
krayonnz.com › user › doubts › detail › 619ba0f3c12ba500474bab3c › what-is-the-difference-between-python-arrays-and-lists
What is the difference between python arrays and lists?
List are a part of python's syntax so they do not need to declared first. Lists can be resized quickly. Arrays are just a thin wrapper on C arrays.
🌐
Enki
enki.com › post › lists-vs-arrays-in-python
Enki | Blog - Lists vs Arrays in Python
In Python, lists and arrays both store and manipulate data, but they differ quite a bit in functionality and performance. Lists are like the Swiss army knife of data storage. They can hold various data types and change size. On the other hand, arrays, especially those provided by libraries like NumPy, are geared towards numerical computations and save memory.
🌐
Medium
medium.com › @cyrilfaith17 › arrays-vs-lists-vs-arraylists-5e99cc9fb0a4
ARRAYS VS LISTS VS ARRAYLISTS. Arrays, Lists, and ArrayLists may sound… | by Faith Sobe Cyril | Medium
February 12, 2024 - Excellent question! Despite the flexibility offered by lists, there are certain limitations that developers may find undesirable. Here are a few reasons for opting for an array over arraylists/lists in Java and Python, respectively.
🌐
Wscube Tech
wscubetech.com › home › difference between list and array in python (with example)
Difference Between List and Array in Python (With Example)
July 14, 2026 - The closest equivalent to ArrayList in Python is a list that refers to an ordered collection of elements. A list can contain duplicate elements. A set is an unordered collection of unique elements that automatically removes a duplicate element.