This works:

a = [[1, 2, 3], [4, 5, 6]]
nd_a = np.array(a)

So this should work too:

nd_a = np.array([[x for x in y] for y in a])
Answer from Marijn van Vliet on Stack Overflow
๐ŸŒ
NumPy
numpy.org โ€บ devdocs โ€บ user โ€บ absolute_beginners.html
NumPy: the absolute basics for beginners โ€” NumPy v2.5.dev0 Manual
Using np.newaxis will increase the dimensions of your array by one dimension when used once. This means that a 1D array will become a 2D array, a 2D array will become a 3D array, and so on.
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ numpy โ€บ numpy_creating_arrays.asp
NumPy Creating Arrays
To create an ndarray, we can pass a list, tuple or any array-like object into the array() method, and it will be converted into an ndarray: ... A dimension in arrays is one level of array depth (nested arrays). nested array: are arrays that ...
๐ŸŒ
DataCamp
campus.datacamp.com โ€บ courses โ€บ intro-to-python-for-data-science โ€บ chapter-4-numpy
2D NumPy Arrays | Python
The arrays np_height and np_weight are one-dimensional arrays, but it's perfectly possible to create 2 dimensional, three dimensional, heck even seven dimensional arrays! Let's stick to 2 in this video though. You can create a 2D numpy array from a regular Python list of lists.
๐ŸŒ
Sentry
sentry.io โ€บ sentry answers โ€บ python โ€บ define a two-dimensional array in python
Define a two-dimensional array in Python | Sentry
The best way to create two-dimensional ... for manipulating multidimensional arrays. We can create a 2D array by passing a tuple to the zeros function....
๐ŸŒ
Python Guides
pythonguides.com โ€บ python-numpy-2d-array
Create A 2D NumPy Array In Python (5 Simple Methods)
May 16, 2025 - The most common way to create a 2D NumPy array is by using the numpy.array() function. This method converts nested Python lists into a multidimensional array.
๐ŸŒ
w3resource
w3resource.com โ€บ python-exercises โ€บ numpy โ€บ python-numpy-exercise-37.php
Python NumPy: Create a 2-dimensional array of size 2 x 3 - w3resource
Write a NumPy program to create a 2-dimensional array of size 2 x 3 (composed of 4-byte integer elements), also print the shape, type and data type of the array. ... # Importing the NumPy library with an alias 'np' import numpy as np # Creating ...
๐ŸŒ
Programiz
programiz.com โ€บ python-programming โ€บ numpy โ€บ ndarray-creation
NumPy N-D Array Creation (With Examples)
We saw how to create N-d NumPy arrays from Python lists. Now we'll see how we can create them from scratch. To create multidimensional arrays from scratch we use functions such as ... The np.zeros() function allows us to create N-D arrays filled with all zeros. For example, ... # create 2D array with 2 rows and 3 columns filled with zeros array1 = np.zeros((2, 3)) print("2-D Array: ") print(array1)
Find elsewhere
๐ŸŒ
Python Examples
pythonexamples.org โ€บ python-numpy-create-2d-array
Create 2D Array in NumPy
The function returns a numpy array with specified shape, and all elements in the array initialised to zeros. import numpy as np # create a 2D array with shape (3, 4) shape = (3, 4) arr = np.zeros(shape) print(arr)
๐ŸŒ
Data Science Dojo
discuss.datasciencedojo.com โ€บ python
How to create a two-dimensional array using NumPy? - Python - Data Science Dojo Discussions
May 15, 2023 - I have comprehended multiple methods that assist me in defining a one-dimensional array using NumPy. Now, I aspire to master methods that help in developing a two-dimensional array. For this purpose, I have found one metโ€ฆ
๐ŸŒ
NumPy
numpy.org โ€บ devdocs โ€บ user โ€บ basics.creation.html
Array creation โ€” NumPy v2.5.dev0 Manual
NumPy arrays can be defined using Python sequences such as lists and tuples. Lists and tuples are defined using [...] and (...), respectively.
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ stable โ€บ user โ€บ basics.creation.html
Array creation โ€” NumPy v2.4 Manual
NumPy arrays can be defined using Python sequences such as lists and tuples. Lists and tuples are defined using [...] and (...), respectively.
๐ŸŒ
Drbeane
drbeane.github.io โ€บ python_dsci โ€บ pages โ€บ array_2d.html
2-Dimensional Arrays โ€” Python for Data Science
The arrays we have worked with up to this point have all been one-dimensional arrays which consist of a sequence of numbers in a linear order. Numpy provides us with tools for creating and working with higher dimensional arrays. In this lesson, we will work exclusively with 2D arrays, which ...
๐ŸŒ
Indian AI Production
indianaiproduction.com โ€บ home โ€บ blog โ€บ python numpy array โ€“ create numpy ndarray (multidimensional array)
Python NumPy array - Create NumPy ndarray (multidimensional array)
June 12, 2019 - In machine learning and data science NumPy 1D array known as vector. Specially use to store and perform an operation on target values. To create NumPy 2D array use array() function and give one argument of items of lists of the list to it.
๐ŸŒ
w3resource
w3resource.com โ€บ python-exercises โ€บ numpy โ€บ basic โ€บ numpy-basic-exercise-46.php
NumPy: Create a two-dimensional array of specified format - w3resource
Construct a 2D array with alternating row patterns and validate its structure with shape checks. Create a 2D array following a defined format and then reshape it into a flat array.
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ multi-dimensional-arrays-in-python
Multi-Dimensional Arrays in Python โ€“ Matrices Explained with Examples
December 11, 2025 - Multi-dimensional arrays are a powerful and important data structure in Python. They allow us to store and manipulate large amounts of data efficiently. In this article, we have covered the basics of creating and manipulating multi-dimensional arrays using NumPy in Python.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-using-2d-arrays-lists-the-right-way
Using 2D arrays/lists in Python - GeeksforGeeks
The code below, compares two ways of initializing a 2D list in Python. Using list multiplication ([[0]*cols]*rows) creates multiple references to the same inner list, causing aliasing where changes affect all rows. Using a nested list comprehension creates a separate list for each row, avoiding aliasing and correctly forming a 2D array.
Published ย  December 20, 2025
๐ŸŒ
YouTube
youtube.com โ€บ watch
Create a Matrix (2D array) in NumPy Python | Module NumPy Tutorial - Part 03 - YouTube
In this video we will talk about How to create a matrix (a 2D array) in python using the numpy module.==================================NumPy Module Tutorial...
Published ย  September 21, 2022
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python-using-2d-arrays-lists-the-right-way
Python | Using 2D arrays/lists the right way - GeeksforGeeks
Given a 3D list, the task is to convert it into a 2D list. These type of problems are encountered while working on projects or w ... Python's NumPy package makes slicing multi-dimensional arrays a valuable tool for data manipulation and analysis.
Published ย  June 20, 2024
๐ŸŒ
OpenGenus
iq.opengenus.org โ€บ 2d-array-in-numpy
2D Arrays in NumPy (Python)
October 28, 2022 - Random Array random.rand(r,c) - this function will generate an array with all random elements.