0 votes
1 view
in Python by (32.3k points)
edited by

I have a list in python and I want to convert it to an array to be able to use ravel() function.

1 Answer

0 votes
by (76.5k points)
edited by

For converting the list to an array you can use numpy.asarray see the code below:-

import numpy as np 

myarray = np.asarray(mylist)

To know more about this you can have a look at the following video tutorial:-

...