title: Is there a limit on tuple size in python?
body: <p>I would like to assemble a training set for a neural network. I have a large csv file with 1017209 rows and 7 columns. I need to extract certain features from this file, and put them into a tuple. I do it the following way:</p>
  
  <pre><code>import pandas as pd
  
  data = pd.read_csv('data.csv', index_col=False, header=0)
  matrix = data.as_matrix()
  
  training_data = ()
  
  for x in range(1017209):
      a = np.ndarray((3,1), buffer=np.array([matrix[x][0],matrix[x][1],matrix[x][5]]), dtype=float)
      b = np.ndarray((1,1), buffer=np.array(matrix[x][3]), dtype=float)
      training_data = training_data + ((a,b),)
  </code></pre>
  
  <p>It works when I loop for about 100000:</p>
  
  <pre><code>for x in range(100000)
  </code></pre>
  
  <p>But not with the full set:</p>
  
  <pre><code>for x in range(1017209)
  </code></pre>
  
  <p>I run it in spyder. It does not break, but does not seem to finish either.  When I set to 100000 it finishes in about a minute. When I set to 1017209 it does not finish even in 45 minutes.</p>
  
  <p>What might be happening? 
  Why do I not receive an error message? 
  Is there a better way to create the same tuple?</p>