0

I'm trying to save a Numpy array in my system using numpy.save. The code is working fine without an error on windows but on linux, the code is working fine but it is not saving the numpy array to the desired location. works fine in windows but on linux i can't see the file

On windows:

import numpy as np
dataset = np.arange(100)
np.save("C:\\Users\\Bhushan\\Documents\\Test.npy",dataset)
#working fine with file saved at the location

On linux:

import numpy as np
dataset = np.arange(100)
np.save("Test.npy",dataset)
# It should save next to the program file but i couldn't see any numpy array file

What could be the problem?

1
  • Check the directory where you are currently working Commented Sep 27, 2018 at 6:24

1 Answer 1

3

If you try

np.load("Test.npy")

you can see if it has actually saved it and you're looking in the wrong place

import os
os.path.abspath(".")

to see where you are (and where the file will be saved)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.