0 votes
1 view
in Python by (47.8k 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 (107k 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:-

Related questions

0 votes
1 answer
asked Jul 15, 2019 in Python by Sammy (47.8k points)
0 votes
1 answer
asked Sep 27, 2019 in Python by Sammy (47.8k points)
0 votes
1 answer
asked Jul 10, 2019 in Java by Ritik (3.5k points)
0 votes
1 answer
asked Oct 3, 2019 in Python by Sammy (47.8k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...