In [2]:
import matplotlib.pyplot as plt
import numpy as np
In [12]:
d = np.arange(16)
In [13]:
d4d = d.reshape((2,2,2,2))
In [15]:
d4d.shape
Out[15]:
In [50]:
d4d[:,:,:,0]
Out[50]:
In [58]:
d4d[:,:,:,1]
Out[58]:
In [44]:
mask = np.array([True] * 8)
In [51]:
mask
Out[51]:
In [46]:
mask[1:5] = False
In [55]:
mask3d= mask.reshape((2,2,2))
In [66]:
mask3d
Out[66]:
In [67]:
masked = d4d[mask3d,:]
In [71]:
masked.shape
Out[71]:
In [72]:
masked[:,0]
Out[72]:
In [73]:
masked[:,1]
Out[73]:
In [ ]: