title: python: continue iteration until a certain condition is met
body: <p>I have a project like the following:</p>
  <pre><code>my_project:
    |__my_new_data
    |      |__new_data.csv
    |
    |__my_original_data
    |      |__original_data.csv
    |__process.py
    |
    |__read.py
  </code></pre>
  <p>I have a function in my read.py that should read data from the data directories in my project, concats them as a panda dataframe and then I import the final dataframe in my process.py to process the data and replace the new_data.csv file in my_new_data_directory</p>
  <pre><code>from typing import Final
  
  def iteration():
      data= []
      my_new_data = pd.read_csv((os.path.join(my_new_data, 'new_data.csv')))
      my_original_data = pd.read_csv((os.path.join(my_original_data, 'original_data.csv'))) 
      all_data = pd.concat([my_new_data, my_original_data])
      all_data.drop_duplicates(subset=&quot;text&quot;, keep=False, inplace=True)
      len_first_comb: Final = len(all_data)
      len_iterated_data = len(all_data)
      
      while len_iterated_data &gt; len_first_comb:
          data.append(all_data)
          continue:
      else:
          print ('iteration is finished.')
      return data
  </code></pre>
  <p>so, what I would like to happen is this process of combining the new_data and the original data to happen at each process until the len of the new data is no longer larger than the len of the first combination. then the iteration stops
  I tried to save the first combination len as a finalized length for comparison, but do not know how to do this comparison iteratively.</p>