[Numpy-discussion] Re: Introducing quarterly date units to datetime64 and timedelta64

2024-02-24 Thread Oyibo
For some reason scenarios 3 & 4 got butchered. 3) Unfamiliar user (pure Numpy): dates = np.asarray(dates, dtype=' Works, but ugly... 4) Advanced user: dates = np.asarray(dates, dtype=' Really, so easy... ___ NumPy-Discussion mailing list -- nu

[Numpy-discussion] Re: Introducing quarterly date units to datetime64 and timedelta64

2024-02-24 Thread Oyibo
Dear Stefano, Thank you for your feedback on the proposal regarding introducing quarterly date units. I appreciate your insight into the existing capabilities already built into NumPy. The support for quarters using the M8[3M] notation is fascinating and new to me. You've raised good points no

[Numpy-discussion] Re: Introducing quarterly date units to datetime64 and timedelta64

2024-02-24 Thread Stefano Miccoli via NumPy-Discussion
Actually quarters (3 months sub-year groupings) are already supported as ‘M8[3M]’ and ‘m8[3M]’: >>> np.datetime64('2024-05').astype('M8[3M]') - np.datetime64('2020-03').astype('M8[3M]') numpy.timedelta64(17,'3M') So explicitly introducing a ‘Q’ time unit is only to enable more int