title: pandas isin function on a for loop
body: <p>1.csv</p>
  
  <pre><code>     cut  price  depth  carat  table
  0   Good    327   57.9   0.23   65.0
  1   Good    335   63.3   0.31   58.0
  2 Very Good 336   62.8   0.24   57.0
  3 Very Good 336   62.3   0.24   57.0
  4 Very Good 337   61.9   0.26   55.0
  5 Premium   326   59.8   0.21   61.0
  6  Premium  334   62.4   0.29   58.0
  7   Good    400   64.0   0.30   55.0
  </code></pre>
  
  <p>2.csv</p>
  
  <pre><code>     cut  price  depth  carat  table
  0   Good    327   57.9   0.23   65.0
  1   Good    335   63.3   0.31   58.0
  2 Very Good 336   62.8   0.24   57.0
  3 Very Good 336   62.3   0.24   57.0
  4 Very Good 337   61.9   0.26   50.0
  5 Premium   326   59.8   0.21   61.0
  6  Premium  334   60.4   0.29   58.0
  7   Good    399   64.0   0.30   55.0
  </code></pre>
  
  <p>only 4,6,7 rows from 2.csv is changed</p>
  
  <p>i'm looking to get </p>
  
  <p>output like this</p>
  
  <pre><code>     cut  price  depth  carat  table
  4 Very Good 337   61.9   0.26   50.0
  6  Premium  334   60.4   0.29   58.0
  7   Good    399   64.0   0.30   55.0
  </code></pre>
  
  <p>can anyone share your experience any kind of help is fine</p>
  
  <pre><code>import pandas as pd
  f1 = pd.read_csv('1.csv')
  f2 = pd.read_csv('2.csv')
  columns_list = ['cut', 'price', 'depth', 'carat', 'table']
  
  new_df= f2[~f2.price.isin(f1.price)]
  print(new_df)
  </code></pre>
  
  <p>this is a sample code i wrote and it's working fine but i need to use the </p>
  
  <p><strong><em>f2[~f2.price.isin(f1.price)]</em></strong></p>
  
  <p>in a loop to get each columns name on that 'price' space and also that will return the value.i tried in normal way like this </p>
  
  <pre><code>for i in columns_list:
  price = f2[~f2.i.isin(f1.i)]
  print(price)
  </code></pre>
  
  <p>but pandas command is not work with like this way it's return an error like</p>
  
  <pre><code>AttributeError: 'DataFrame' object has no attribute 'i'
  </code></pre>
  
  <p>Thankz for reading, i hope you understand this</p>