pandas merge with MultiIndex, when only one level of index is to be used as key
问题 I have a data frame called df1 with a 2-level MultiIndex (levels: '_Date' and _'ItemId'). There are multiple instances of each value of '_ItemId', like this: _SomeOtherLabel _Date _ItemId 2014-10-05 6588921 AA 6592520 AB 6836143 BA 2014-10-11 6588921 CA 6592520 CB 6836143 DA I have a second data frame called df2 with '_ItemId' used as a key (not the index). In this df, there is only one occurrence of each value of _ItemId: _ItemId _Cat 0 6588921 6_1 1 6592520 6_1 2 6836143 7_1 I want to