title: Insert pandas dataframe value based on multiple column conditions
body: <p>In python, I have a <strong>list</strong> of 68K files named <code>files_in_folder</code>. Additionally, I have a csv file (pd dataframe) with filenames and extensions. An example:</p>
  <pre><code>import pandas as pd
  import os 
  
  files_in_folder = ['2.fds', '4.fds', '5.jpg']
  
  df = pd.DataFrame({'filename': ['1.fds', '2.fds', '3.fds', '4.fds', '5.jpg'],
                     'correct_extension?': [None, None, None, None, None],
                     'extension': ['.fds', None, '.json', '.fds', '.jpg']
                    })
  </code></pre>
  <p>For every item in the <strong>list</strong> I check if the file is in column 'filename'. If the correct extension is in column 'extension' <code>True</code> should be added in column 'correct_extension?' at that row.</p>
  <p>On stack I found numpy's 'where', that could do something like this:</p>
  <pre><code>for file in files_in_folder:
      extension = os.path.splitext(file)
      df['correct_extension?'] = np.where( ( (df['filename'] == file) &amp; (df['extension'] == extension ) ) , True, False)
  </code></pre>
  <p>However, because of my loop, this method doesn't give the expected results (below). I am looking for someone that can give me a hint on how to solve this problem, preferably with a loop.</p>
  <p>I'm very eager to learn from you.</p>
  <pre><code>expected result: dataframe -&gt;
  'filename': ['1.fds', '2.fds', '3.fds', '4.fds', '5.jpg'],
  'correct_extension?': [None, None, None, True, True],
  'extension': ['.fds', None, '.json', '.fds', '.jpeg']
  </code></pre>
  <p>A similar topic I found was:
  <a href="https://stackoverflow.com/questions/30631841/pandas-how-do-i-assign-values-based-on-multiple-conditions-for-existing-columns">Pandas: How do I assign values based on multiple conditions for existing columns?</a></p>