Open kyrollosyanny opened 2 weeks ago
Describe the bug Would it be possible given an array A, bad row indices and bad column indices to make a new array that does not have these rows or columns similar to np.delete? But also hoping for it to be efficient
np.delete
This can be done with np.delete as follows:
To Reproduce
import numpy as np A=np.random.rand(20,16) bad_col=np.arange(0,A.shape[1],4)[1:] bad_row=np.arange(0,A.shape[0],4)[1:] Anew=np.delete(np.delete(A,bad_row,0),bad_col,1) print('old shape ',A.shape) print('new shape ',Anew.shape)
Thank you
Describe the bug Would it be possible given an array A, bad row indices and bad column indices to make a new array that does not have these rows or columns similar to
np.delete
? But also hoping for it to be efficientThis can be done with np.delete as follows:
To Reproduce
Thank you