def match_bwv_bag(self, adres, bag):
    new_df = pd.merge(adres, bag, how='left', left_on=['sttnaam', 'hsnr'], right_on=['_openbare_ruimte_naam_nummeraanduiding', 'huisnummer_nummeraanduiding'])
    g = new_df.groupby('adres_id')
    df_direct = g.filter((lambda x: (len(x) == 1)))
    df_multiple = g.filter((lambda x: (len(x) > 1)))
    df_multiple = df_multiple[((df_multiple['hsltr'] == df_multiple['huisletter_nummeraanduiding']) & (df_multiple['toev'] == df_multiple['huisnummer_toevoeging_nummeraanduiding']))]
    df_result = pd.concat([df_direct, df_multiple])
    df_result = df_result.sort_values(['adres_id', 'status_coordinaat_code'])
    df_result = df_result.drop_duplicates(subset='adres_id', keep='first')
    final_df = pd.merge(adres, df_result, how='left', on='adres_id', suffixes=('', '_y'))
    final_df.drop(list(final_df.filter(regex='_y$')), axis=1, inplace=True)
    final_df.name = 'adres'
    return final_df
def match_bwv_bag(self, adres, bag):
    new_df = pd.merge(adres, bag, how='left', left_on=['sttnaam', 'hsnr'], right_on=['_openbare_ruimte_naam_nummeraanduiding', 'huisnummer_nummeraanduiding'])
    g = new_df.groupby('adres_id')
    df_direct = g.filter((lambda x: (len(x) == 1)))
    df_multiple = g.filter((lambda x: (len(x) > 1)))
    df_multiple = df_multiple[((df_multiple['hsltr'] == df_multiple['huisletter_nummeraanduiding']) & (df_multiple['toev'] == df_multiple['huisnummer_toevoeging_nummeraanduiding']))]
    df_result = pd.concat([df_direct, df_multiple])
    df_result = df_result.sort_values(['adres_id', 'status_coordinaat_code'])
    df_result = df_result.drop_duplicates(subset='adres_id', keep='first')
    final_df = pd.merge(adres, df_result, how='left', on='adres_id', suffixes=(, '_y'))
    final_df.drop(list(final_df.filter(regex='_y$')), axis=1, inplace=True)
    final_df.name = 'adres'
    return final_df