This question already has an answer here:
I have a multi-index dataframe that looks like
uid tid text
abc x t1
bcd y t2
uid and tid are the indexes. I have a list of uids, and want to get the rows corresponding to the uids in that list, but keeping the 2nd level index values (tid). I want to do it without running any explicit loop. Is that possible?
Data:
1.slicers
2.
boolean indexing
+ mask withget_level_values
+isin
:3.
query
, docs: