def get_region_period_spec_val_subtable(df, region=None, period=None, col='typemaatwerkarrangement', spec_value=None):
    """
    Method to subset the dataframe based on a certain region, period and specific value of a column.

    Parameters
    ----------
    df : pd.DataFrame
        DataFrame with the WMO data from CBS with the columns 'codering_regio', 'perioden' and a specific to subset on
        which gives a type, i.e. a column to subset on type of WMO.
    region : str
        String to choose region. Possible strings are: "gemeente", "wijk"
    period : str
        String to choose period. Possible strings are: "jaar", "halfjaar"
    col : str
        Column where the type of WMO will be subsetted
    spec_value : str
        String to choose specific value for the selected column. I.e. form of type of WMO, could be type of financing,
        but also type of customization.

    Returns
    -------
    pd.DataFrame
    """

    if region == "gemeente":
        df = df[df.codering_regio.str.startswith('GM', na=False)]
    if region == "wijk":
        df = df[df.codering_regio.str.startswith('WK', na=False)]
    if region == "buurt":
        df = df[df.codering_regio.str.startswith('BU', na=False)]
    if period == "jaar":
        df = df[~df.perioden.str.contains("halfjaar", na=False)]
    if period == "halfjaar":
        df = df[df.perioden.str.contains("halfjaar", na=False)]
    if spec_value != None:
        df = df[df[col] == spec_value]

    return df