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), and via the methods and attributes of the ndarray.
🌐
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.
🌐
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 ...
Find elsewhere
🌐
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.
🌐
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 ...
🌐
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:
🌐
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 ...
🌐
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)
🌐
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)
🌐
Fabienmaussion
fabienmaussion.info β€Ί intro_to_programming β€Ί week_09 β€Ί 01-multidim-numpy.html
Multi-dimensional numpy arrays β€” Introduction to Programming
For the final two weeks of the semester, you will learn to manipulate multi-dimensional arrays (ndarrays) which are very common in meteorology, climatology, and geosciences in general. import numpy as np import matplotlib.pyplot as plt