Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k 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 (106k 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.6k points)
0 votes
1 answer
asked Mar 7, 2021 in Java by dante07 (13.1k points)
0 votes
1 answer
asked Sep 27, 2019 in Python by Sammy (47.6k 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.6k points)

Browse Categories

...