An alternative is to use np.ravel:

>>> np.zeros((3,3)).ravel()
array([ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.])

The importance of ravel over flatten is ravel only copies data if necessary and usually returns a view, while flatten will always return a copy of the data.

To use reshape to flatten the array:

tt = t.reshape(-1)
Answer from Daniel on Stack Overflow
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.ndarray.html
numpy.ndarray — NumPy v2.4 Manual
Used to fill the array with data. ... Offset of array data in buffer. ... Strides of data in memory. ... Row-major (C-style) or column-major (Fortran-style) order. ... Construct an array. ... Create an array, each element of which is zero. ... Create an array, but leave its allocated memory unchanged (i.e., it contains “garbage”). ... Create a data-type. ... An ndarray alias generic w.r.t.
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.asarray.html
numpy.asarray — NumPy v2.2 Manual
If a is a subclass of ndarray, a base class ndarray is returned. ... Similar function which passes through subclasses. ... Convert input to a contiguous array.
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.asarray.html
numpy.asarray — NumPy v2.4 Manual
If a is a subclass of ndarray, a base class ndarray is returned. ... Similar function which passes through subclasses. ... Convert input to a contiguous array.
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.ndarray.tolist.html
numpy.ndarray.tolist — NumPy v2.5.dev0 Manual
ndarray.tolist()# Return the array as an a.ndim-levels deep nested list of Python scalars. 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. If a.ndim is 0, then since the depth of the nested list is 0, it will not be a list at all, but a simple Python scalar.
🌐
NumPy
numpy.org › doc › stable › reference › arrays.ndarray.html
The N-dimensional array (ndarray) — NumPy v2.4 Manual
Generally, accessing an array through its attributes allows you to get and sometimes set intrinsic properties of the array without creating a new array. The exposed attributes are the core parts of an array and only some of them can be reset meaningfully without creating a new array. Information on each attribute is given below. The following attributes contain information about the memory layout of the array: ... The array interface protocol. An ndarray object has many methods which operate on or with the array in some fashion, typically returning an array result.
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.ndarray.html
numpy.ndarray — NumPy v2.5.dev0 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.
🌐
W3Schools
w3schools.com › python › numpy › numpy_creating_arrays.asp
NumPy Creating Arrays
NumPy is used to work with arrays. The array object in NumPy is called ndarray.
Find elsewhere
🌐
Medium
medium.com › @whyamit404 › converting-numpy-ndarray-to-a-list-step-by-step-guide-defdfb09bcbe
Converting NumPy ndarray to a List (Step-by-Step Guide) | by whyamit404 | Medium
February 9, 2025 - tolist(): Converts the entire array into a list, including all nested dimensions (if it’s a 2D or 3D array). list(): Only converts the outermost dimension into a Python list. If the array is multidimensional, each inner element will still be a NumPy array. ... import numpy as np # Creating a 2D NumPy array ndarray = np.array([[1, 2], [3, 4]]) # Using tolist() list_result = ndarray.tolist() print("Using tolist():", list_result) # Using list() list_function_result = list(ndarray) print("Using list():", list_function_result)
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.array.html
numpy.array — NumPy v2.4 Manual
If None, a copy will only be made ... Note that any copy of the data is shallow, i.e., for arrays with object dtype, the new array will point to the same objects. See Examples for ndarray.copy....
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.ndarray.html
numpy.ndarray — NumPy v2.2 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.
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.ndarray.tolist.html
numpy.ndarray.tolist — NumPy v2.4 Manual
ndarray.tolist()# Return the array as an a.ndim-levels deep nested list of Python scalars. 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. If a.ndim is 0, then since the depth of the nested list is 0, it will not be a list at all, but a simple Python scalar.
🌐
GeeksforGeeks
geeksforgeeks.org › numpy › numpy-ndarray
Numpy - ndarray - GeeksforGeeks
July 26, 2025 - Understanding the attributes of an ndarray is important while working with NumPy effectively. Here are the key attributes: ndarray.shape: Returns a tuple representing the shape (dimensions) of the array. ndarray.ndim: Returns the number of dimensions (axes) of the array. ndarray.size: Returns the total number of elements in the array.
🌐
NumPy
numpy.org › doc › 2.3 › reference › generated › numpy.ndarray.html
numpy.ndarray — NumPy v2.3 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.
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.ndarray.tolist.html
numpy.ndarray.tolist — NumPy v2.1 Manual
ndarray.tolist()# Return the array as an a.ndim-levels deep nested list of Python scalars. 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. If a.ndim is 0, then since the depth of the nested list is 0, it will not be a list at all, but a simple Python scalar.
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-convert-numpy-matrix-to-array
How to Convert NumPy Matrix to Array - GeeksforGeeks
July 23, 2025 - In this example, we are using numpy.flatten() method to convert a NumPy Matrix into a NumPy Array. It utilizes the complete N-dimensional array of the matrix’s elements.
🌐
Note.nkmk.me
note.nkmk.me › home › python › numpy
Convert between NumPy array and Python list | note.nkmk.me
January 23, 2024 - You can convert a NumPy array (ndarray) to a list with the tolist() method of ndarray.
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.ndarray.tolist.html
numpy.ndarray.tolist — NumPy v2.2 Manual
ndarray.tolist()# Return the array as an a.ndim-levels deep nested list of Python scalars. 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. If a.ndim is 0, then since the depth of the nested list is 0, it will not be a list at all, but a simple Python scalar.
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.ndarray.html
numpy.ndarray — NumPy v2.1 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.