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 โ€บ doc โ€บ stable โ€บ reference โ€บ arrays.ndarray.html
The N-dimensional array (ndarray) โ€” NumPy v2.4 Manual
The type of items in the array is specified by a separate data-type object (dtype), one of which is associated with each ndarray. As with other container objects in Python, the contents of an ndarray can be accessed and modified by indexing or slicing the array (using, for example, N integers), ...
๐ŸŒ
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.
๐ŸŒ
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.
๐ŸŒ
Medium
medium.com โ€บ @bouimouass.o โ€บ what-does-a-numpy-2d-array-look-like-in-python-38752ccde895
What does a numpy 2D array look like in python? | by Omar | Medium
July 23, 2023 - What does a numpy 2D array look like in python? A NumPy 2D array is a rectangular array of data. It is a two-dimensional array, which means it has rows and columns. The rows are represented by the โ€ฆ
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ numpy โ€บ numpy_creating_arrays.asp
NumPy Creating Arrays
Like in above code it shows that arr is numpy.ndarray type. 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 have arrays as their elements. 0-D arrays, or Scalars, are the elements in an array. Each value in an array is a 0-D array.
๐ŸŒ
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 consist of several values arranged into ordered rows and columns.
๐ŸŒ
OpenGenus
iq.opengenus.org โ€บ 2d-array-in-numpy
2D Arrays in NumPy (Python)
October 28, 2022 - For working with numpy we need to first import it into python code base. ... To get a specific element from an array use arr[r,c] here r specifies row number and c column number.
Find elsewhere
๐ŸŒ
Python Guides
pythonguides.com โ€บ python-numpy-2d-array
Create A 2D NumPy Array In Python (5 Simple Methods)
May 16, 2025 - In this article, Iโ€™ll show you five easy methods to create 2D NumPy arrays (also known as matrices) based on my decade of experience working with Python.
๐ŸŒ
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....
๐ŸŒ
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 ...
๐ŸŒ
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. Lists and tuples can define ndarray creation: a list of numbers will create a 1D array, a list of lists will create a 2D array, further nested lists ...
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ multi-dimensional-arrays-in-python
Multi-Dimensional Arrays in Python โ€“ Matrices Explained with Examples
December 11, 2025 - NumPy provides a powerful N-dimensional array object that you can use to create and manipulate multi-dimensional arrays efficiently. We'll now look at some examples of how to create and work with multi-dimensional arrays in Python using NumPy.
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ numpy โ€บ numpy_array_iterating.asp
NumPy Array Iterating
import numpy as np arr = np.array([1, 2, 3]) for x in np.nditer(arr, flags=['buffered'], op_dtypes=['S']): print(x) Try it Yourself ยป ยท We can use filtering and followed by iteration. Iterate through every scalar element of the 2D array skipping 1 element:
๐ŸŒ
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.
๐ŸŒ
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)
๐ŸŒ
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. Lists and tuples can define ndarray creation: a list of numbers will create a 1D array, a list of lists will create a 2D array, further nested lists ...
๐ŸŒ
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โ€ฆ