print(np.array(pairs, dtype=("i4,i4")).reshape(I1[:,:,1].shape))
print("Channel 3:")
pairs = list(zip(I1[:,:,2].ravel(), D3.ravel()))
print(np.array(pairs, dtype=("i4,i4")).reshape(I1[:,:,2].shape))
else:
print("Error, too many dimensions:", I1.shape)
After Change
print(pairs_diff)
print("Channel 3:")
pairs = list(zip(I1[:,:,2].ravel(), D3.ravel()))
pairs_diff = [p for p in pairs if p[1]!=0]
//print(np.array(pairs, dtype=("i4,i4")).reshape(I1[:,:,2].shape))
print(pairs_diff)
else:
print("Error, too many dimensions:", I1.shape)