'How to apply a 2D boolean array on a 3D dask array in python

I have a boolean array A of size (5250, 3) and another dask array D of size (5250, 6850, 3). I am trying to do D[A]. But it is giving the error

NotImplementedError: Slicing with dask.array of bools only permitted when the indexer has only one dimension or when it has the same dimension as the sliced array`

How to apply 2D boolean array on 3D dask array?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source