I have a dataframe:

```
4  Amazon        2      x  0.0     2.0     4.0    6.0    8.0
5  Amazon        2      y  0.0     1.0     2.0    3.0    4.0

```

df2:

```
     Amazon   2      60
     Netflix  1      100
     Netflix  2      110

```

I am trying to compare the slope values in the axis column to the corresponding optimal cost values and extract the slope, x and y values that are closest to the optimal cost.

Expected output:

```
0  Amazon        1      120    2   0.8
1  Amazon        2      57     4   2

```