def dcut(dts, freq='d', right=True):
    hi = pd.Period(dts.max(), freq=freq) + 1
periods = pd.PeriodIndex(start=dts.min(), end=hi, freq=freq)
bounds = np.array(periods.to_timestamp(how='start'), dtype='int')
cut = pd.cut(np.array(dts, dtype='int'), bins=bounds, right=right)
What's the equivalent of cut/qcut for pandas date fields?