title: How do I skip a for loop iteration if a condition is met when iterating through multiple files in pandas?
body: <p>I'm using os and glob to create a list of CSVs first and then using a simple for loop I go through all the files in the path applying my code.</p>
  <pre><code>path = r'my path'
  os.chdir(path)
  FileList = glob.glob('*.csv')
  
  for fname in FileList:
  Session = pd.read_csv(fname, header = 3, usecols = [0, 1])
  Session = Session[Session['System'].str.contains('Day', na=False)]
  Session = Session['No System Name'].tolist()
  CRFs = sum([&quot;CRF&quot; in x for x in Session])
  ...
  df.to_csv(path + 'test_' + fname , index = 0)
  </code></pre>
  <p>Is there a way I can make the loop skip a file if the length of Session equals to CRFs the loop will just stop and restart with the next file in the FileList?
  I've tried doing it like this using both break and continue but neither did anything:</p>
  <pre><code>for fname in FileList:
  
  Session = pd.read_csv(fname, header = 3, usecols = [0, 1])
  Session = Session[Session['System'].str.contains('Day', na=False)]
  Session = Session['No System Name'].tolist()
  CRFs = sum([&quot;CRF&quot; in x for x in Session])
  if CRFs == len(Session) is True: 
      continue(or break)
  ...
  df.to_csv(path + 'test_' + fname , index = 0)
  </code></pre>
  <p>Many thanks in advance!</p>