I have 'univer' dataframe which has state and region name as columns,
State RegionName
0 Alabama Auburn
1 Alabama Florence
2 Alabama Jacksonville
3 Alabama Livingston
and 'statobot' dataframe has state and region name as index,
State RegionName 2008Q3 2009Q2 ratio
AK Anchor Point NaN NaN NaN
Anchorage 296166.666667 271933.333333 1.089115
Fairbanks 249966.666667 225833.333333 1.106863
Homer NaN NaN NaN
Juneau 305133.333333 282666.666667 1.079481
Kenai NaN NaN NaN
Ketchikan NaN NaN NaN
Kodiak NaN NaN NaN
Lakes 257433.333333 257200.000000 1.000907
North Pole 241833.333333 219366.666667 1.102416
Palmer 259466.666667 263800.000000 0.983573
now I want to select rows in 'statobot' dataframe based on 'univer' dataframe, the state and region name must be exact fit, I have tried using
haveuni = statobot[(statobot.index.get_level_values(0).isin(univer['State'])) &(statobot.index.get_level_values(1).isin(univer['RegionName']))]
but the result rows are much more than I expected. Is there any other way to be more exact fit?