Can boolean indexing be used with multi-level indexes?

Question

Grade: Education Subject: Ddos
Can boolean indexing be used with multi-level indexes?
Asked by:
54 Viewed 54 Answers

Answer (54)

Best Answer
(250)
Yes, boolean indexing works with DataFrames that have multi-level indexes. The boolean mask should have the same shape as the index structure. You can use boolean indexing on specific levels of the index by slicing the index before applying the mask.