Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

I need to know if it is possible to save a python list as a numPy array.

1 Answer

0 votes
by (106k points)

To save a list as a numpy array in Python you can create an array from a sequence.

from numpy import array

a = array( [2,3,4] )

Or 

From you can use a sequence of sequences.

from numpy import array

a = array( [[2,3,4], [3,4,5]] )

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

Related questions

0 votes
1 answer
asked Oct 3, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...