title: From a file containing prime numbers to a list of integers on Python
body: <p>In order to work out some asymptotic behavior on the topic of <a href="https://mathworld.wolfram.com/TwinPrimeConjecture.html" rel="nofollow noreferrer">twin prime conjecture</a>, I am required to take a raw file(<code>.csv</code> or <code>.txt</code>) and convert that data into a list in python where I could reach by pointing its index number.</p>
  <p>That is, I have a big(~10 million numbers) <em>list</em> of prime numbers in <code>.csv</code> file, lets say that this is that list:</p>
  <pre><code>2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83
  </code></pre>
  <p>I am and trying to produce the following</p>
  <pre><code>[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83]
  </code></pre>
  <p>in order to examine, ay the third element in the list, which is 5.</p>
  <p>The approach I am taking is the following:</p>
  <pre><code>import sys
  import csv
  
  # The csv file might contain very huge fields, therefore increase the field_size_limit:
  
  csv.field_size_limit(sys.maxsize)
  
  with open('primes1.csv') as csvfile:
      reader = csv.reader(csvfile, delimiter=' ')
  
      output = []
      for i in reader:
          output.append(i)
  </code></pre>
  <p>Then, if printing,</p>
  <pre><code>for rows in output:
      print(rows)
  </code></pre>
  <p>I am getting</p>
  <pre><code>['2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83'].
  </code></pre>
  <p>How does one resolve this? Thank you very much.</p>