MultiIndex.get_indexer()

pandas.MultiIndex.get_indexer

MultiIndex.get_indexer(target, method=None, limit=None, tolerance=None)

Compute indexer and mask for new index given the current index. The indexer should be then used as an input to ndarray.take to align the current data to the new index. The mask determines whether labels are found or not in the current index

登录查看完整内容
Parameters:

target : MultiIndex or Index (of tuples)

method : {‘pad’, ‘ffill’, ‘backfill’, ‘bfill’}

pad / ffill: propagate LAST valid observation forward to next valid backfill / bfill: use NEXT valid observation to fill gap