I have created a 2D mask appropriately named mask to have the same shape as the array data, the array I want to apply it upon. However when I do so, the data loses it's shape and becomes 1D.
I thought that as each level for axis 0 is identical (shown with creation of mask using loop comprehension) that the output would produce output with shape (837, 10)
I am wondering is there any numpy tricks to be used to achieve this goal without using reshape?
>>> data.shape
(837, 44)
>>> m = altitudes < 50000
>>> m.shape
(44,)
>>> np.sum(m) # calculates my expected dimension for axis 1
10
>>> mask = [m for i in range(data.shape[0])]
>>> mask.shape
(837, 44)
>>> new_data = data[mask]
>>> new_data.shape
(8370,) # same as 837 * 10 (dimension wanted)
If this can't be achieved, why would this be?