For some reason scenarios 3 & 4 got butchered.
3) Unfamiliar user (pure Numpy):
dates = np.asarray(dates, dtype='<M8[M]')
months_less_one = dates.astype(np.int64) % 12
diff_months = (months_less_one - months_less_one // 3 * 3).astype('<M8[M]')
dates -= diff_months
=> Works, but ugly...
4) Advanced user:
dates = np.asarray(dates, dtype='<M8[M]')
=> Really, so easy...
_______________________________________________
NumPy-Discussion mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: [email protected]