Performance PyTables中的切片
使用Pytable对h5中保存的阵列进行切片的最快方法是什么 情况如下:Performance PyTables中的切片,performance,optimization,pytables,Performance,Optimization,Pytables,使用Pytable对h5中保存的阵列进行切片的最快方法是什么 情况如下: 数据已保存(此处无需优化): 数据将被打开: h5file = tables.openFile(hd5_filename, mode="r") node = h5file.getNode('/', data_node) X = getattr(node, X_str) 这就是我需要优化的地方,我需要对许多索引和不同的最小/最大位置进行大量无法排序的以下类型的数组切片: for index, min_x, min_y,
h5file = tables.openFile(hd5_filename, mode="r")
node = h5file.getNode('/', data_node)
X = getattr(node, X_str)
for index, min_x, min_y, min_z, max_x, max_y, max_z in my_very_long_list:
current_item = X[index][min_x:max_x,min_y:max_y,min_z:max_z]
do_something(current_item)
for index, min_x, min_y, min_z, max_x, max_y, max_z in my_very_long_list:
current_item = X[index][min_x:max_x,min_y:max_y,min_z:max_z]
do_something(current_item)