title: real time data acquisition/processing using Python
body: <p>I am attempting to write a code that will acquire information from a buffer (returned as a multi-dimentional array), extract certain elements from said array.  </p>
  
  <p>So here's what I have:</p>
  
  <pre><code>Drest = np.array([])              #Set up array for data to be read to (not sure if this is needed)
  t_end = time.time() + 5            
  while time.time() &lt; t_end:
  Drest = ftc.getData()             #fts is the buffer that I'm connecting to.
  print("Drest: %s" %Drest)
  </code></pre>
  
  <p>This returns an output which looks like this: </p>
  
  <pre><code>[[  6.79609478e-01   6.79609478e-01   6.79609478e-01   6.79609478e-01
  6.79609478e-01   6.79609478e-01   6.79609478e-01   6.79609478e-01
  6.79609478e-01   6.79609478e-01   6.79609478e-01   6.79609478e-01
  6.79609478e-01   6.79609478e-01   6.79609478e-01   6.79609478e-01]
  [  6.81910694e-01   6.81910694e-01   6.81910694e-01   6.81910694e-01
  6.81910694e-01   6.81910694e-01   6.81910694e-01   6.81910694e-01
  6.81910694e-01   6.81910694e-01   6.81910694e-01   6.81910694e-01
  6.81910694e-01   6.81910694e-01   6.81910694e-01   6.81910694e-01]]
  </code></pre>
  
  <p><strong>Question 1</strong> As the data comes in, I would like to add a "0" as a first element of each array, so I essentially have a first column full of zeros.  I have attempted this, but it doesn't add it to every one of, just the very first element, not the first in each element of each array.</p>
  
  <pre><code>block = 1
  np.append(block, [Drest])
  </code></pre>
  
  <p><strong>Question 2</strong>
  I also need to create a mean of every other "column" from the multi-dimensional array, so I have tried this, but I can't for the life of me get this to work! </p>
  
  <pre><code> for i in range(0, len(Drest), 2):
      HbO2 = Drest[i]
      HbO2Rest = sum(HbO2)/float(len(HbO2))
  </code></pre>
  
  <p>Thanks in anticipation of your help :)</p>