[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] Converting array to string

2024-02-24 Thread Dom Grigonis
Hello, I am seeking a bit of help. I need a fast way to transfer numpy arrays in json format. Thus, converting array to list is not an option and I need something similar to: a = np.ones(1000) %timeit a.tobytes() 17.6 ms This is quick, fast and portable. In other words I am very happy with t

[Numpy-discussion] Re: JSON format for multi-dimensional data

2024-02-24 Thread philippe
Thank you Matti for this response. I completed issue 12481 because in my opinion the format proposal responds to this issue. However, if you think a specific issue is preferable, I can create it. To fully understand the proposed standard, it involves representing multidimensional data that has

[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

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

2024-02-24 Thread Oyibo
Dear Numpy Team, I am writing to propose the addition of quarterly date units (Q) to the datetime64 and timedelta64 data types in Numpy. While Numpy currently supports various date units, including years, months, weeks, and days, the absence of quarterly units limits its usability in numerous