tacco.utils.flat_inverse_mapping

flat_inverse_mapping(condensed_mapping)[source]

Given a condensed mapping construct a flat inverse mapping.

Parameters:

condensed_mapping – A mapping from coarse to a list-like of (or a single) fine categories as dict, Series, etc. or anything else with a .items method.

Returns:

Returns a Series containing a mapping from fine to coarse categories.