title: Extracting an array from a dataframe column that contains an array
body: <p>I am using thorns and cochlea to generate a spiketrain. The result is in the form of a pandas.DataFrame in the form, that the column 'spikes' contains the array of spiketimes that I need.</p>
  
  <p><a href="https://i.stack.imgur.com/k7R6f.png" rel="nofollow noreferrer">DataFrame generated by thorns</a></p>
  
  <p>When I try to extract it with</p>
  
  <pre><code>a = df.as_matrix(['spikes'])
  </code></pre>
  
  <p>the resulting matrix will always look like this:</p>
  
  <pre><code>a = [[array([1,2,3])][array([4,5,6])]]
  </code></pre>
  
  <p>to further use the data, i need the form:</p>
  
  <pre><code>a= [[1,2,3][4,5,6]]
  </code></pre>
  
  <p>how can I delete the array() part?</p>
  
  <p>This is the code I use:</p>
  
  <pre><code>import cochlea
  
  import thorns.waves as wv
  
  #generating the spiketrain
  
  sound = wv.ramped_tone(fs=100e3,freq=500,duration=0.3,dbspl=60)
  spiketrain=cochlea.run_zilany2014(sound,fs=100e3,anf_num=(2,0,0),cf=500,seed=0,species='human')
  print spiketrain
  
  #trying to extrakt spiketime information
  a = spiketrain.as_matrix(['spikes'])
  print 'a='
  print a
  </code></pre>