How to save a list as numpy array in python? How to save a list as numpy array in python? numpy numpy

How to save a list as numpy array in python?


First of all, I'd recommend you to go through NumPy's Quickstart tutorial, which will probably help with these basic questions.

You can directly create an array from a list as:

import numpy as npa = np.array( [2,3,4] )

Or from a from a nested list in the same way:

import numpy as npa = np.array( [[2,3,4], [3,4,5]] )


you mean something like this ?

from numpy  import arraya = array( your_list )