title: pandas: extract certain rows as a dataframe by the value of a column
body: <p>I have a list of column value and from a existing dataframe I want to extract the row by this column value by using a loop since the list has lots of values. </p>
  
  <pre><code>list = [2,4,5,6,7,8, ....., 2345]
  df # df is an existing dataframe 
  #'number' is the name of the column that has the value of list in it 
  
  for i in list:
      df.loc[(df["number"] == i)])
  df
  
  for i in list:
     P = pd.DataFrame(df.loc[(df["number"] == i)])
  P # extract only one column of a certain number
  </code></pre>
  
  <p>both does not get the result I want. </p>