hmmmbob
hmmmbob

Reputation: 1177

numpy array, slicing 4d array (tensor)

I want to access a 4d numpy.ndarray( don't know exactly how and if it differs from a tensor). i want the 3d array (cube when) the 4th dimension has the index 1 for example.

i tried something like

 array[:][:][:][1] 

but no avail

Upvotes: 1

Views: 603

Answers (1)

piRSquared
piRSquared

Reputation: 294278

Should just be:

array[:, :, :, 1]

Upvotes: 2

Related Questions