title: how to perform histogram on numpy array whose dtype is object using histogramdd?
body: <p>I want to perform histogram on a <code>(N, 3) numpy array</code>, whose three dimensions represent longitude, latitude and time-stamp correspondingly, like this:</p>
  
  <pre><code>array([[116.45565032958984, 39.889976501464844,
          datetime.datetime(2012, 10, 1, 6, 32, 39)],
         [116.45565032958984, 39.889984130859375,
          datetime.datetime(2012, 10, 1, 6, 33, 31)],
         [116.45565032958984, 39.889984130859375,
          datetime.datetime(2012, 10, 1, 6, 33, 33)],
         [116.45565032958984, 39.889984130859375,
          datetime.datetime(2012, 10, 1, 6, 33, 37)],
         [116.45561981201172, 39.89040756225586,
          datetime.datetime(2012, 10, 1, 6, 34, 42)],
         [116.45561981201172, 39.890411376953125,
          datetime.datetime(2012, 10, 1, 6, 36, 40)],
         [116.45549774169922, 39.8941650390625,
          datetime.datetime(2012, 10, 1, 6, 37, 54)],
         [116.45556640625, 39.92431640625,
          datetime.datetime(2012, 10, 1, 6, 38, 57)],
         [116.45578002929688, 39.93780517578125,
          datetime.datetime(2012, 10, 1, 6, 42, 10)],
         [116.44468688964844, 39.93989944458008,
          datetime.datetime(2012, 10, 1, 6, 43, 21)]], dtype=object)
  </code></pre>
  
  <p>I tried to use <code>np.histogramdd</code> like this:</p>
  
  <pre><code>import numpy as np
  np.histogramdd(my_data, bins = (lon_bin_num, lat_bin_num, time_bin_num), 
                  range = [[lon_min, lon_max], [lat_min, lat_max], 
                  [start_datetime, end_datetime]])
  </code></pre>
  
  <p>And got <code>TypeError</code>:</p>
  
  <pre><code>---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-271-58c94eecf21d&gt; in &lt;module&gt;()
        1 np.histogramdd(tmp2, bins = (lon_bin_num, lat_bin_num, time_bin_num),
  ----&gt; 2                range = [[lon_min, lon_max], [lat_min, lat_max], [start_datetime, end_datetime]])
  
  /*/*/anaconda/lib/python2.7/site-packages/numpy/lib/function_base.pyc in histogramdd(sample, bins, range, normed, weights)
      318         smax = zeros(D)
      319         for i in arange(D):
  --&gt; 320             smin[i], smax[i] = range[i]
      321 
      322     # Make sure the bins have a finite width.
  
  TypeError: float() argument must be a string or a number
  </code></pre>
  
  <p>I know it was the datetime object causing the error, but I want to know how to correct this error or how to perform histogram on numpy ndarray whose <code>dtype = object</code>?</p>