I have two dataframes as follows:

```
  patient id      A      B
0  EHR123456  0.415  0.230
1  EHR987653  0.854  0.705
2  EHR657483  0.364  0.881

     Mood    A    B
0  Type A  0.4  0.8
1  Type B  0.2  0.6
2  Type C  0.2  0.4
3  Type D  0.4  0.2
4  Type E  0.6  0.2
5  Type F  0.8  0.4
6  Type G  0.8  0.6
7  Type H  0.6  0.8

```

The first dataframe contains patients with results from test A and test B (about 10k rows). The second dataframe contains 8 pre-defined categories (mood) with values for A and B. How can I assign a category (mood) to every patient based on the closest match with one of the categories from the second dataframe (taking A and B into account)?