title: Passing in name in function and using it as a value in a Pandas column
body: <p>I want to create several (10) dataframes on information on different subject exams. For instance, I will need Science, English, Math, etc. </p>
  
  <p>Expected output:</p>
  
  <pre class="lang-none prettyprint-override"><code>     Exam  Student ID Final Score
  0    SXRX   000000000          99
  1    SXRX   000000001         100
  2    SXRX   000000011          99
  3    EXRC   111111110         100
  4    EXRC   111111100          99
  </code></pre>
  
  <p>Current inputs:</p>
  
  <pre class="lang-none prettyprint-override"><code>&gt;&gt;&gt;SXRX_dl_df
  ...
       Student ID Final Score
  0    000000000          99
  1    000000001         100
  2    000000011          99
  
  &gt;&gt;&gt;EXRC_dl_df
  ...
       Student ID Final Score
  0    111111110         100
  1    111111100          99
  </code></pre>
  
  <p>I have created a script that performs the data analysis for Science. My script has this kind of structure:</p>
  
  <pre class="lang-py prettyprint-override"><code>def subject_df(subject, subject_dl_df):
      # logic
  
      df = pd.DataFrame()
  
      df['Exam'] = subject
  
      df['Last Name'] = subject_dl_df['Last Name']
  
      # more logic
  
      return df
  
  
  SXRX_df = subject_df('SXRX', SXRX_dl_df)
  </code></pre>
  
  <p>I was hoping to genericize it so that I could apply every subject into it (perhaps from a list), however, Python currently won't let me use the parameter I pass in as a value for the column. The code above gives me back NaNs for <code>df['Exam']</code>. It works fine if I apply <code>SXRX_df['Exam'] = 'SXRX'</code> afterwards, but that's more ad hoc and I was hoping for a better solution.</p>
  
  <p>Right now, the subject name is in the source filename itself, if that helps.</p>
  
  <p>How can I reapply this script 10 times for different subjects and ensure the right subject is under the <code>Subject</code> column each time?</p>