我似乎无法让 numpy.digitize 与 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)
它给出了以下错误:
TypeError: Cannot cast array data from dtype('<M8[s]') to dtype('float64') according to the rule 'safe'
这是预期的行为吗?