title: Python Iterator Over Dataframe or List with Stock Data
body: <p>I'm working on a personal project - more of a learning venture than anything and the project consists of a few what may seem common tasks for data wrangling in python.  I've tried multiple avenues to solve on my own or with information gleaned form other threads, but no luck just yet.</p>
  <p>Some background:
  I'm trying to take a list or dataframe of stock tickers and pass into the ticker module of yfinance to pull history for a large list of stocks.  Sounds simple - and probably is for someone who's lived with Python for a while.</p>
  <p>My script:</p>
  <pre><code>import yfinance as yf
  import pandas as pd
  from get_all_tickers import get_tickers as gt
  list_of_tickers = gt.get_tickers()
  tickerlist = pd.DataFrame(list_of_tickers, columns = [&quot;Ticker&quot;])
  tickerlist = tickerlist.values.tolist()
  tc = &quot;&quot;
  for x in tickerlist:
      tc += str(x)
  
  tc = tc.replace(&quot; &quot;, &quot;&quot;)
  tc = tc.replace(&quot;[&quot;, &quot;,&quot;)
  tc = tc.replace(&quot;]&quot;, &quot;&quot;)
  tc = tc.replace(&quot;'&quot;, &quot;&quot;)
  #tc = &quot;,&quot;.join(tc)   
  
  def Convert(string): 
      li = list(string.split(&quot;,&quot;)) 
      return li 
  
  tc = Convert(tc)
  df = pd.DataFrame(data=tc, columns = [&quot;Ticker&quot;])
  df_filtered = df.iloc[1: , : ]
  #df_filtered.update('&quot;' + df_filtered[['Ticker']].astype(str) + '&quot;')
  # df_filtered.to_csv(&quot;./StockTickers.csv&quot;, sep=',',index=False)
  list_filtered = df_filtered.values.tolist()
  
  # valid periods: 1d,5d,1mo,3mo,6mo,1y,2y,5y,10y,ytd,max
  period= &quot;1d&quot;
  # valid intervals: 1m,2m,5m,15m,30m,60m,90m,1h,1d,5d,1wk,1mo,3mo
  interval = &quot;1d&quot;
  
  #=============================================================================
  for ticker in df_filtered: #df_filtered.iterrows():
      ticker = str(ticker).upper()
      ticker = yf.Ticker(&quot;DDD&quot;)
      history = ticker.history(
                              period = period,
                              interval = interval
                              )
      
  
      print(history)
      print(df_filtered)
  </code></pre>