[英]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做这件事的方法
.dat
file and produce a numpy array在 python 中编写脚本以读取.dat
文件并生成 numpy 数组 .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.