成人一对一视频交友

如何加快h5py写作?

elbert
elbert

带着h5py .File(os.path.join(args.data,f'{args.city_name}.h5 ‘,’ w’) as f:

f .attrs[‘ num ‘]=len(routes _ valid)

f.create_group(‘/trips/coord ‘)

f.create_group(‘/trips/osmid ‘)

f.create_group(‘/trips/length ‘)

对于范围内的I(len(routes _ length)):

f .create _ dataset(f ‘/trips/coord/{ I 1 } ‘,data=np.array(routes_coord[i])

f .create _ dataset(f ‘/trips/osmid/{ I 1 } ‘,data=np.array(routes_valid[i])

f .create _ dataset(f ‘/trips/length/{ I 1 } ‘,data=np.array(routes_length[i])

i % 5_0000==0和打印时间(f ‘保存了{i}次行程(

大约有150w条数据,后面速度变得巨慢无比XoC4A3M

elbert
品牌