简体   繁体   English

可以将 Fortrana arrays 保存为.npy 格式吗?

[英]Can one save Fortrana arrays in .npy format?

I am using Fortran for my numerical computations.我正在使用 Fortran 进行数值计算。 The common standard in Fortran is to save the array as a .dat file. Fortran 中的通用标准是将数组保存为.dat文件。 I want to occasionally transfer the array to Python for further manipulations.我想偶尔将数组转移到 Python 以进行进一步操作。 Ways to do this thing做这件事的方法

  • Write a script in python to read the .dat file and produce a numpy array在 python 中编写脚本以读取.dat文件并生成 numpy 数组
  • Use something like HDF5, NETCDF, etc while saving the array (accessible in Python)在保存数组时使用 HDF5、NETCDF 等(可在 Python 中访问)

.dat file script reader would need to be customised t0 the way the arrays are stored. .dat文件脚本阅读器需要按照 arrays 的存储方式进行定制。 Would need to store probably one array per file for ease of use.为了便于使用,每个文件可能需要存储一个数组。 My arrays are not that big so, I am not fond of using HDF5.我的 arrays 没有那么大,所以我不喜欢使用 HDF5。 But do let me know if there is no other option.但是,如果没有其他选择,请告诉我。

I have not used it yet, but MRedies NPY-for-Fortran seems to be what you are looking for.我还没有使用它,但MRedies NPY-for-Fortran似乎是您正在寻找的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 python-将字典保存为.npy格式 - python - save dict to .npy format 如何将“n”个数组保存到“n”个npy文件? - How to save 'n' arrays to 'n' npy files? 无法以python作为cPickle.PicklingError在TensorFlow中以.npy格式保存numpy - Can't save numpy in .npy format in TensorFlow with python as cPickle.PicklingError 如何将扫描数据(主题)保存在 npy 文件中? - How can I save scan data(topic) in npy file? 如何上传多个.npy 文件以合并到一个数组中? - How can I upload multiple .npy files to consolidate into one array? 如何以与CNN中使用的类似格式在.npy文件中保存权重? - How to save weights in .npy file in a similar format which is being used in CNN? 对 .npy 格式的图像使用 ImageDataGenerator - Using ImageDataGenerator with images in .npy format 将多个训练数据npy文件附加到一个npy文件 - Append multiple training data npy files to one npy file 如何将 append arrays 转换为现有的.npy 文件 - How to append arrays to an existing .npy file 乳清使用numpy.save/numpy.load将浮点数组的numpy数组保存到.npy文件中,是否有任何理由为什么数组的顺序会改变? - 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?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM