# How To Create NumPy Array From List In Python

Hello coders, do you want to know how to create NumPy array from list? So in this tutorial you will learn to create numpy array from list. We will learn to create 1d, 2d, 3d and multidimensional NumPy array from list.

But before proceeding ahead you should check previous tutorial of NumPy array creation.

How To Create NumPy Array In Python

A list is a most common data structure in Python. It holds heterogenous data and it is mutable. A NumPy array can be create with many things like NumPy inbuilt functions, tuples, lists etc. But in this how to create NumPy array from list tutorial, we will learn to create NumPy array from list.

## How To Make NumPy Array From List

We can create NumPy array from list using two methods array() and asarray().

So let’s start to learn to create NumPy array from list.

### Create NumPy Array Using array() method

We can create NumPy array from list using array() method in the following ways.

#### 1d NumPy array from list

Run the following code to create one dimensional NumPy array from list.

• First of all we have imported NumPy module.
• Then created a list.
• And using array() method created NumPy array from list. We have passed list as argument.
• Then finally printed the array.

Output #### 2d NumPy Array From List

• Here we have created a nested list of same size.
• And then passed this list to the array() method. It will create 2d NumPy array.

Output #### 3d NumPy Array From List

To create NumPy 3d array from list, we have to pass 2d array as arguments to the array() method. So let’s see how to do that.

Let’s see its output.

Output #### Create NumPy Array From List Of Tuples

• Here we have created a list of tuples and passed it to the array() method.
• This will convert the list of tuples into NumPy array.

Output #### Create NumPy Array From List Of Strings

• Here we have passed a list of strings.

Output #### Create a NumPy Array From a List With Different Data Type

To create NumPy array from list with different data type, we have to specify dtype argument in the array() method.

• Here we have specified float data type.

Output ### Create NumPy Array Using asarray() method

So in this section we will learn creating NumPy array using asarray() method.

asarray() method is used to convert the given input into an array. So let’s start.

#### Create NumPy Array From List

• Here we have created a list and passed into the asarray() method.
• It will convert the list into an array.

Output #### Create NumPy Array From List Of Lists

• Here we have passed list of lists to create array.

Output Lets check it’s dimension.

Output #### Create NumPy Array From List Of Tuples

Output So guys it was all about how to create NumPy array from list tutorial. I hope you have found it helpful, if yes then make sure to share it with your fellows who are learning NumPy. And if you have any queries regarding this tutorial then feel free to ask in comment. THANKS