![](/img/trans.png)
[英]Whey saving an numpy array of float arrays to .npy file using numpy.save/numpy.load, is there any reason why the order of the arrays would change?
[英]Why is numpy.save not saving the file on linux
我正在尝试使用numpy.save在系统中保存一个Numpy数组。 该代码在Windows上运行正常,没有错误,但在Linux上,该代码运行正常,但未将numpy数组保存到所需位置。 在Windows中工作正常,但在Linux上我看不到文件
在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
在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
可能是什么问题呢?
如果你试试
np.load("Test.npy")
您可以查看它是否确实保存了它,并且查找位置错误
import os
os.path.abspath(".")
查看您的位置(以及文件的保存位置)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.