Solved by ptrblck in post #2 
              
              
                The first example uses “boolean array indexing” while the second uses plain indexing as described in the numpy advanced indexing docs. 
If you call print('mask_b', data[mask_b.byte()]), you’ll get the same result.