python - h5py causes jupyter to crash in for loop
问题描述
I am using a for loop to load arrays with different names into a h5py file. The goal is to load matlab files as python files from each independent folder, then to store all these loaded arrays into a h5py file.
Code:
with h5py.File("Filename.hdf5", 'w') as f:
for i in Data_names:
try:
f.create_dataset(str(i), data = scipy.io.loadmat('./folder/' + str(i) + '/wantedfile.mat'))
except IOError:
pass
The code seems to work for the first 6 values of i, then starts to glitch. One of the error is a file save error and this also causes problems with opening any of my other notebooks.
Is the error in that the h5py file is too large? or is the problem an error with my for loop?
解决方案
推荐阅读
- python - 在取熊猫中数据框的特定子集的平均值时如何获得更好的性能?
- html - 我遇到了 target="_blank" 的问题。它不适合我
- python - 自定义损失函数中的 Keras 即时样本权重计算
- typescript - Visual Studio 2015 给出“预期的 TS1110 类型”。对于数字文字类型联合别名
- java - 从资源文件夹中获取 Json 文件
- azure - 逻辑应用的直到循环限制是如何工作的?
- javascript - JavaScript:对数组元素进行排序,其中“真实”字段值排在首位
- wizard - react-final-form - 向导表单从父级访问值
- c - 实现 atoi - 递增变量 j 时出现分段错误
- android - 签名的 APK 构建失败 re:play-services-ads-identifier.properties 冲突