title: Permutation and Combinations in Python Pandas
body: <p>I will like to find the most optimized way of doing search on Pandas DataFrame</p>
  
  <p>For example</p>
  
  <p>I will like to search for value </p>
  
  <pre><code>aaa = 9 in the dataframe df
  </code></pre>
  
  <h2>df</h2>
  
  <pre><code>  index Column  value
     1     aaa      1
     2     aaa      3
     3     aaa      5
     4     aaa     -3 
     5     aaa      3
     6     aaa      0
  </code></pre>
  
  <p>It should result in the following</p>
  
  <pre><code>Answer: Combinations of Index locations (1,2,3), (1,2,3,4,5),(1,2,3,6),(1,2,3,4,5,6), (1,3,5), (1,3,5,6) 
  </code></pre>
  
  <p>as they all sum upto <strong>9</strong></p>
  
  <p>I am avoiding to run permutation loop for n^n times for all combinations.
  Any short cuts will be highly appreciated</p>