How to save numpy array

0 votes

Hi Guys,

I am new to the NumPy module. I have one array in NumPy. I want to save this array for future use. How can I do this?

Jun 22, 2020 in Python by akhtar
• 38,230 points
1,540 views

1 answer to this question.

0 votes

Hi@akhtar,

You can use numpy.save() function to save your array. It stores the input array in a disk file with npy extension. I have attached one example below.

import numpy as np 
a = np.array([1,2,3,4,5]) 
np.save('outfile',a)

I hope this will help.

answered Jun 22, 2020 by MD
• 95,440 points

Related Questions In Python

0 votes
1 answer

How to save Numpy array as image in python?

If you have matplotlib, you can do: import ...READ MORE

answered Nov 16, 2018 in Python by Nymeria
• 3,560 points
8,556 views
0 votes
1 answer
0 votes
1 answer

How to create Pandas series from numpy array?

Hi. Refer to the below command: import pandas ...READ MORE

answered Apr 1, 2019 in Python by Pavan
3,225 views
0 votes
1 answer

How to convert pandas dataframe to numpy array?

Irrespective of whether the dataframe has similar ...READ MORE

answered May 13, 2019 in Python by Rishi
6,501 views
0 votes
1 answer
0 votes
1 answer

Doubt in numpy.vstack

The vstack function in numpy will stack ...READ MORE

answered Jul 30, 2019 in Python by Esha
817 views
0 votes
1 answer
0 votes
1 answer

How to load Numpy array in Jupyter Notebook?

Hi@akhtar, You can use numpy.load() function to load ...READ MORE

answered Jun 22, 2020 in Python by MD
• 95,440 points
10,636 views
+1 vote
1 answer

How to save graph using matplotlib library?

Hi@akhtar, You can find one function called savefig ...READ MORE

answered May 21, 2020 in Python by MD
• 95,440 points
1,234 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP