title: pandas dataframe get row numbers and add to list
body: <p>Lets assume we have a panda dataframes with three features as represented below. </p>
  
  <p><a href="https://i.stack.imgur.com/ELj9W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ELj9W.png" alt="enter image description here"></a></p>
  
  <p>Each rows is representing a customer and each column representing some features of this customer. </p>
  
  <p>I would like to get row number and add them to a list or not add them to list according to their feature values. </p>
  
  <p>Lets say, we would like to find row numbers if FEATUREA less than 100 or FEATUREB more than 500. </p>
  
  <p>I have written some code for this as you can see below. </p>
  
  <pre><code>import pandas as pd
  
  d = [{'feature1': 100, 'feature2': 520, 'feature3': 54},
       {'feature1': 102, 'feature2': 504, 'feature3': 51},
       {'feature1': 241, 'feature2': 124, 'feature3': 4},
       {'feature1': 340, 'feature2': 830, 'feature3': 700},
       {'feature1': 98, 'feature2': 430, 'feature3': 123}]
  
  df = DataFrame(d)
  print(df)
  print("----")
  
  dataframe1 = df[(df['feature1'] &lt; 100)]
  dataframe2 = df[(df['feature2'] &gt; 500)]
  
  print(dataframe1)
  print(dataframe2)
  # here I would like to get row number temp and add them to result list
  </code></pre>
  
  <p>Output of the program</p>
  
  <pre><code>      feature1  feature2  feature3
  0       100       520        54
  1       102       504        51
  2       241       124         4
  3       340       830       700
  4        98       430       123
  ----
     feature1  feature2  feature3
  4        98       430       123
     feature1  feature2  feature3
  0       100       520        54
  1       102       504        51
  3       340       830       700
  </code></pre>
  
  <p>I could not figure out how to combine dataframe1 and dataframe2 and then get theirs row number. Could you please share if you know how to do it?</p>
  
  <p>I would like to see a result list like that</p>
  
  <pre><code>result = [ 4, 0, 1, 3]
  </code></pre>