title: Carrying resulting dataframes through different functions
body: <p>I have 8 functions that I would like to run under one main() function. The process starts with importing from a file and creating a df and then doing some cleaning operations on that df under a new function. I have copied in the basic structure including the three starting functions and then a main() function. What I am unsure about is how to 'carry' the result of loader() to clean_data() and then the result of clean_data() to operation_one() in the right way. At the moment I get an error that df is not defined. Thank you for your help!</p>
  <pre><code>def loader():
  
      import pandas as pd
      import numpy as np
  
      df = pd.read_excel('file_example.xlsx')
      return df
  
  
  def clean_data():
          
      del df['column_7']
      return df
  
  
  def operation_one():
          
      del df['column_12']
      return df
  
  
  def main():
  
      loader()
      clean_data()
      operation_one()
  
      with pd.ExcelWriter(file.xlsx&quot;) as writer:
          df.to_excel(writer, sheet_name='test' , index=False)
  
  if __name__ == &quot;__main__&quot;:
      main()
  </code></pre>