def ic_to_gamma(df, water_level):
    """
    Assign the right gamma (unit soil weight kN/m^3) to the corresponding Ic.

    :param df: (DataFrame) Original DataFrame.
    :param water_level: (int) Water level with respect to ground level.
    :return: Updated DataFrame.
    """
    mask_below_water = -df['depth'].values < water_level
    df = df.assign(gamma_predict=1)
    ic_mask = df['type_index'].values > 3.6
    df.loc[ic_mask, 'gamma_predict'] = 11
    ic_mask = df['type_index'].values <= 3.6
    df.loc[ic_mask, 'gamma_predict'] = 16
    ic_mask = df['type_index'].values <= 2.95
    df.loc[ic_mask, 'gamma_predict'] = 18
    ic_mask = df['type_index'].values <= 2.6
    df.loc[ic_mask & mask_below_water, 'gamma_predict'] = 19
    ic_mask = df['type_index'].values <= 2.05
    df.loc[ic_mask & mask_below_water, 'gamma_predict'] = 20
    return df
