title: How to select a particular column value from a pandas dataframe when another column in the same row is NaN?
body: <p>I'm pretty new to pandas, and I'm trying to do a simple operation. I'm trying to make some comparisons and pick some values from a column when a condition is met. But I don't know how to give these conditions in Pandas. It's very straightforward using lists but in dataframe it's new to me.</p>
  
  <p>A code example is as follows:</p>
  
  <pre><code>import pandas as pd
  
  df = pd.DataFrame({'Student_Subjects_Initial': ['A','B','C','D'],
                      'Student_Marks_Initial': [10,23,3,45],
                      'Student_Subjects_Final': ['A',np.nan,'C','D'],
                      'Student_Marks_Final': [10,23,3,np.nan]})
  </code></pre>
  
  <p>This will give me the below in <code>df</code>:</p>
  
  <pre><code> Student_Subjects_Initial   Student_Marks_Initial   Student_Subjects_Final  Student_Marks_Final
  0   A                           10                      A                       10.0
  1   B                           23                      nan                     23.0
  2   C                           3                       C                       3.0
  3   D                           45                      D                       nan
  </code></pre>
  
  <p>What I'm trying to do is pick the value from <code>Student_Subjects_Initial</code> where <code>Student_Subjects_Final</code> is <code>nan</code>.
  So, my output should simply be:</p>
  
  <pre><code>Mismatches_Student_Subject_Initial:
  B
  </code></pre>
  
  <p>But I'm unable to get my head around writing the conditon for pandas dataframe.</p>
  
  <p>Can someone please help? Thanks in advance.</p>