假设你有3D数组。对于大型数组,执行以下操作的最快方法是什么:
If:
i_low < i < i_high and
j_low < j < j_high and
k_low < k < k_high
Then:
change the element value to 1发布于 2016-04-10 04:55:19
一种相对较快的方法是使用NumPy的切片:
a[i_low+1:i_high, j_low+1:j_high, k_low+1:k_high] = 1https://stackoverflow.com/questions/36522533
复制相似问题