title: Reading .csv files into Python lists
body: <p>I have a lot of .csv files in a directory and I'd like to open each of them in a loop within Python such that the first .csv is read into list[0] and the second .csv is read into list[1] and so on.</p>
  
  <p>Unfortunately, while my code loops through all of the .csv files, it puts all the .csv files into list[0]. How can I modify my code so that I can achieve my goal above? Many thanks.</p>
  
  <p>John</p>
  
  <p>Here's the code:</p>
  
  <pre><code>def create_data_lists():
  i=0
  for symbol in symbols:
      with open(symbols[i]+'.csv', 'r') as f:
          print i
          reader = csv.reader(f)
          reader.next()
          for row in reader:
              rowdata.append(row)
      data_by_symbol.append(rowdata)
      i=i+1
  </code></pre>