How to exclude rows/columns from numpy.ndarray data
numpy, python
Solution
You can use `b = numpy.delete(a, indices, axis=0)`
Source: NumPy docs.
Problem
Assume we have a numpy.ndarray data, let say with the shape (100,200), and you also have a list of indices which you want to exclude from the data. How would you do that? Something like this: ``` a = numpy.random.rand(100,200) indices = numpy.random.randint(100,size=20) b = a[-indices,:] # imaginary code, what to replace here? ``` Thanks.