title: How to put a datetime value into a numpy array?
body: <p>I am learning python so please bear with me.  I have been trying to get a datetime 
  variable into a numpy array, but have not been able to figure out how.  I need to calculate differences between times for each index later on, so I didn't know if I should put the datetime variable into the array, or convert it to another data type.  I get the error:</p>
  
  <pre><code>'NoneType' object does not support item assignment
  </code></pre>
  
  <p>Is my dtype variable constructed correctly? <a href="http://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html" rel="nofollow">This</a> says nothing about datetime type.</p>
  
  <pre><code>import numpy as np
  from liblas import file
  
  f = file.File(project_file, mode = 'r')
  num_points = int(f.__len())
  # dtype should be [float, float, float, int, int, datetime]
  dt = [('x', 'f4'), ('y', 'f4'), ('z', 'f4'), ('i', 'u2'), ('c', 'u1'), ('time', 'datetime64')]
  xyzict = np.empty(shape=(num_points, 6), dtype = dt)
  
  # Load all points into numpy array
  counter = 0
  for p in f:
      newrow = [p.x, p.y, p.z, p.i, p.c, p.time]
      xyzict[counter] = newrow     
      counter += 1
  </code></pre>
  
  <p>Thanks in advance</p>
  
  <p>EDIT: I should note that I plan on sorting the array by date before proceeding.</p>
  
  <p>p.time is in the following format:</p>
  
  <pre><code>&gt;&gt;&gt;p.time
  datetime.datetime(1971, 6, 26, 19, 37, 12, 713269)
  &gt;&gt;&gt;str(p.time)
  '1971-06-26 19:37:12.713275'
  </code></pre>