我有一个 Python 代码,它的输出是一个 < img src = “ https://i.stack.imgur.com/keJsR.png”alt = “ enter image description here”> size Matrix,它的条目都是 float
类型的。如果我用扩展名 .dat
保存它,文件大小为500MB。我读到使用 h5py
可以大大减小文件大小。假设我有一个名为 A
的2D 数字数组。如何将其保存到 h5py 文件中?
Also, how do I read the same file and put it as a numpy array in a different code, as I need to do manipulations with the array?