def unstack(df, level=(- 1), reset_index=True):
    'pd.DataFrame.unstack adapter.\n\n    Call the `df.unstack` method using the indicated level and afterwards\n    join the column names using an underscore.\n\n    Args:\n        df (pandas.DataFrame): DataFrame to unstack.\n        level (str, int or list): Level(s) of index to unstack, can pass level name\n        reset_index (bool): Whether to reset the index after unstacking\n\n    Returns:\n        pandas.Dataframe: unstacked dataframe\n    '
    df = df.unstack(level=level)
    if reset_index:
        df = df.reset_index()
        df.columns = df.columns.map(_join_names)
    return df
pd.DataFrame.unstack adapter.

Call the `df.unstack` method using the indicated level and afterwards
join the column names using an underscore.

Args:
    df (pandas.DataFrame): DataFrame to unstack.
    level (str, int or list): Level(s) of index to unstack, can pass level name
    reset_index (bool): Whether to reset the index after unstacking

Returns:
    pandas.Dataframe: unstacked dataframe
def unstack(df, level=(- 1), reset_index=True):
    'pd.DataFrame.unstack adapter.\n\n    Call the `df.unstack` method using the indicated level and afterwards\n    join the column names using an underscore.\n\n    Args:\n        df (pandas.DataFrame): DataFrame to unstack.\n        level (str, int or list): Level(s) of index to unstack, can pass level name\n        reset_index (bool): Whether to reset the index after unstacking\n\n    Returns:\n        pandas.Dataframe: unstacked dataframe\n    '
    df = df.unstack(level=level)
    if reset_index:
        df = df.reset_index()
        df.columns = df.columns.map(_join_names)
    return df