df_status = df.filter(like='status')
df_type = df.filter(like='type')
df_type_lookup = df_type.applymap(lambda x: other_table.loc[x]).values
df['A'] = np.sum((df_status == 0).values * df_type_lookup, 1)
df['B'] = np.sum((df_status == 1).values * df_type_lookup, 1)
Pandas Calculate Sum of Multiple Columns Given Multiple Conditions