I am trying to pull the top results in a pandas data frame given a list of parameters in another pandas data frame. I am not sure how to go about doing this. I have the following data frames. I would like to link my symbols in df1 with df2 that match in Years and have lowest price. I do not want to go over the amount to buy in df1. So as an example, I would like to buy all of x1 and 75000 of x2 to fulfill my X order in df1. I would like to create a list of all symbols in df2 that will fulfill the orders in df1. Any suggestions?

```
df1 = pd.DataFrame({'Symbol':list('XYZ'),'Amount to buy':[125000,200000,50000],'Years':[5,7,3]})

Symbol  Amount to Buy    Years
X      125000               5
Y      200000               7
Z      50000                3

df2 = pd.DataFrame({'Symbol':'X1,X2,Y1,Y2,Z1,Z2'.split(','),'Amount Offered':[50000,100000,165000,110000,85000,90000],'Years':[5,5,7,7,3,3],'Price':'$5,$6,$3,$5,$7,$10'.split(',')})

Symbol   Amount Offered  Years  Price
  X1            50000       5    $5
  X2           100000       5    $6
  Y1           165000       7    $3
  Y2           110000       7    $5
  Z1           85000        3    $7
  Z2            90000       3    $10

for Amount_Offered in df2.iterrows():
    if Amount_Offered < x_buy:
        print ('buy this')

ValueError: The truth value of a Series is ambiguous. Use a.empty, 
 a.bool(), a.item(), a.any() or a.all().

```

Edit: so far I have set my X amounnt to buy as a variable, x\_buy