title: Loop Through Tickers
body: <p>I have a program that opens a stock's data file, feeds it to a function which turns the date into a datetime index, and then returns the file and outputs it as a csv. It works fine, here is the code:</p>
  <pre><code>import pandas as pd
  
  def clean_func(f1):
      f1['Date'] = pd.to_datetime(f1['Date']) 
      f1.index = f1['Date']
      return f1
      
  df = pd.read_csv(r'C:\\path\\tkr.csv')
  df1 = clean_func(df)
  df1.to_csv('C:\\path\\tkr.csv')
  </code></pre>
  <p>Rather than have redundant lines of code for each ticker (&quot;tkr&quot; above), I'd like to create a list of ticker symbols and loop through them. I'm not sure how embed everything correctly to loop through a list hence this post. Please advise.</p>
  <p>Thank you</p>