title: Import a csv file to a list of lists
body: <p>I have <a href="https://pastebin.com/3qKVrxed" rel="nofollow noreferrer">this</a> csv file created using <code>writerow</code> function from the csv module. The file has 63 lines. I want to create a list of lists in python from this file.</p>
  
  <p>I tried the following code:</p>
  
  <pre><code>import csv
  
  dataset = []
  
  def importCsv(file):
      x = 0
      print(dataset)
      with open(file, newline='') as csvfile:
          data = csv.reader(csvfile, delimiter=',', quotechar='|')
          for row in data:
              #print(type(row))
              dataset.append(row)
              x += 1
          print(x)
  
  importCsv(csvPath)
  </code></pre>
  
  <p>But when I try <code>print(len(dataset))</code>, it outputs 126 instead of 63. I am really confused. Why is the number of items in dataset so high?</p>