I can't seem to get numpy.digitize to work with datetime64:
date_bins = np.array([np.datetime64(datetime.datetime(2014, n, 1), 's') for n in range(1,13)])
np.digitize(date_bins, date_bins)
It gives the following error:
TypeError: Cannot cast array data from dtype('<M8[s]') to dtype('float64') according to the rule 'safe'
Is this expected behaviour?