def convert_annual_costs_nominal_to_real(
    nominal_costs, inflation_rate=1.02, year=2022
):
    """Convert cost values of DataFrame from nominal to real terms

    Parameters
    ----------
    nominal_costs: pd.DataFrame
        Nominal costs data in annual resolution (years = columns)

    inflation_rate: float
        Inflation rate

    year: int
        Year for which the nominal costs shall be expressed

    Returns
    -------
    real_costs: :obj:`pd.DataFrame`
        Real costs data in annual resolution
    """
    real_costs = nominal_costs.copy()
    for column in real_costs.columns:
        if column != "label":
            try:
                real_costs[column] = real_costs[column].div(
                    inflation_rate ** (int(column) - year)
                )
            except TypeError:
                msg = (
                    "DataFrame format not as expected\n"
                    "Except for column 'label', "
                    "all other columns must have column names of type int!"
                )
                raise TypeError(msg)

    return real_costs