def _reduce_sampled_fluxes(sampled_fluxes, reactions):
    """
    Reduces the input dataframe of sampled fluxes to a subset of
    selected reactions.

    Parameters
    ----------
    sampled_fluxes : pandas.Dataframe
        The calculated fluxes, output of sampling. For each reaction,
        n fluxes will be calculated (n = number of samples taken).
    reactions : list
        List of reactions, e.g. output of `get_subsytem_reactions()`.

    Returns
    -------
    re_arranged_df : pandas.Dataframe
        Sampled fluxes reduced to a specified set of reactions.
    """
    reactions_mask = [
        True if col in reactions else False for col in sampled_fluxes.columns
    ]
    subsystem_df = sampled_fluxes[sampled_fluxes.columns[reactions_mask]]
    re_arranged_df = subsystem_df.stack().reset_index(
        level=[1], name="Sampled Fluxes"
    )
    re_arranged_df = re_arranged_df.rename(
        columns={"level_1": "Reaction"}
    ).reset_index(drop=True)
    return re_arranged_df