shnitsel.core.xrhelpers.assign_levels

assign_levels(obj, levels=None, **levels_kwargs)

Assign new values to levels of MultiIndexes in obj

Parameters:
Return type:

A new object with the new level values replacing the old level values.

Raises:

ValueError – If levels are provided in both keyword and dictionary form.