adrin - 1 year ago 94

Python Question

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.

Source (Stackoverflow)