title: Compute product of all combinations of a dataframe column with two conditions
body: <p>I have pandas dataframe consisting of 3 columns that has information regarding loans:</p>
  <pre><code>LoanKey  ProbOfDefault    EL(expected loss)
  1          100%             546
  2          90%              102
  3.         92%              1009
  .           .                .
  .           .                .
  .           .                .
  303        13%              68
  </code></pre>
  <p>I need to find a combination of loans with the highest cumulative <code>EL</code> value that will have a probability of default between <code>0.9%-1%.</code></p>
  <p>For example, a single combination can consist of 3 loans:</p>
  <pre><code>loan1 - PD=30%; EL=372
  loan2 - PD=10%; EL=1792
  loan3 - PD=3%;  EL=123
  
  cummulative EL=372+1792+123=2287
  cummulative PD = 30%*10%*3%=0.9%
  </code></pre>
  <p>I tried converting my pandas columns to lists and using <code>itertools.combinations</code> to find all possible combinations of loans and calculating PD and EL of each combination, picking one with <code>0.9%&lt;=PD&lt;=1%</code> and max. EL, but my solution took too long to compute since a number of possible combinations is extremely large.</p>
  <p>Is there a smarter way of solving this problem?</p>