Python: Index an array using the colon operator in an arbitrary dimension
Python: Index an array using the colon operator in an arbitrary dimension Question: I have a numpy nd array. A simplified version of my task is to take a vector from along each axis. To illustrate: import numpy x = numpy.array(range(24)).reshape((2,3,4)) x0 = x[0,0,:] x1 = x[0,:,0] x2 = x[:,0,0] However I do not necessarily …
Total answers: 3