title: Python "Can't Assign to Operator" Error using loop function
body: <p>I am attempting to run a loop to import several zipped text files into Pandas and create cross-tabulations.  The code is below:</p>
  
  <pre><code>def delta_calc(start_year,end_year):
  for x in range(start_year, end_year+1,1):
      return
      "disposition"+x+"_24mo_df"=pd.read_table("path/lps_"+x+".txt",compression='gzip',sep='\t')
      "disposition"+x+"_24mo_df".sort(['loan_id','last_paid_interest_date'], ascending=[True,False], inplace=True)
      "disposition"+x+"_24mo_nodups_df"="disposition"+x+"_24mo_df".drop_duplicates('loan_id')
      "disposition"+x+"_24mo_crosstab"=pd.crosstab("disposition"+x+"_24mo_nodups_df".initial_investor_code,"disposition"+x+"_24mo_nodups_df".current_investor_code, margins=True)
  </code></pre>
  
  <p>However, I get the following error message:</p>
  
  <pre><code>   File "&lt;ipython-input-63-d662d71d1354&gt;", line 4
             "disposition"+x+"_24mo_df"=pd.read_table("path/lps_"+x+".txt",compression='gzip'    ,sep='\t')
  ^
  SyntaxError: can't assign to operator
  </code></pre>
  
  <p>Any assistance would be greatly appreciated.</p>