title: create array using numpy for-loop
body: <p>Ok, so i have wrapped a C library in Python and called the corresponding DLL's
  then i created a for loop that prints out all 60,000 data points which then crashes Python.</p>
  <h1>This is my question:</h1>
  <p>How can I create a for loop in numpy so it is faster and doesn't crash python?</p>
  <p>Here is a small sample of the C library that i have wrapped and the dll that i'm calling:</p>
  <pre><code>import ctypes 
  from ctypes import * 
  
  class SParm(Structure):
  pass
  
  SParm._fields_ = [
          ('name', ctypes.c_char_p),
          ('time', ctypes.POINTER(ctypes.c_float)),  
  
  dll.readSParm.argtypes = (POINTER(SFile), c_char_p, c_double, c_double,    c_double, POINTER(TTag), c_ushort,)   
  dll.readSParm.restype = POINTER(SParm)
  
  g = dll.readSParm(SF, ParmName, startTime, stopTime, Null, None, convertType)
  </code></pre>
  <p>This is Python for-loop that I have created.</p>
  <pre><code>time = (g[0].time)
  for i in (time):
  print(i)
  </code></pre>
  <p>^ this prints out values and then crashes python before its finished</p>
  <p>I was trying something like this:</p>
  <pre><code>time = (g[0].time)
  for i in (time):
  np.savetxt(sys.stdout, i)
  </code></pre>
  <p>but the code above throws this error at me:</p>
  <pre><code>ncol = X.shape[1]
  IndexError: tuple index out of range
  </code></pre>