print('Shapes of ind, X1 and X3')
print(ind.shape)
print(X1.shape)
print(X3.shape)
print('Contents of ind, X1 and X3')
print(ind)
print(X1)
print(X3)
print('Shape of np.nonzero( np.sum( X3, axis=1 ) )[0]')
print(np.nonzero(np.sum(X3, axis=1))[0].shape)
print('Shape of np.nonzero( np.sum( X3, axis=1 ) )[0]')
print(np.nonzero(np.sum(X3[(ind), :], axis=1))[0].shape)
rearranging rows in a big numpy array zeros some rows. How to fix it?