pint icon indicating copy to clipboard operation
pint copied to clipboard

NEP 42 Support : New and extensible DTypes

Open jules-ch opened this issue 2 years ago • 3 comments

Numpy is going to introduce custom Dtypes to embed metadata. The scope clearly add units as one of the use case, and dtypes like datetime etc.

Is it already used in pandas and such ? This is something that could be interesting to support.

https://numpy.org/neps/nep-0042-new-dtypes.html#motivation-and-scope

jules-ch avatar Feb 23 '22 22:02 jules-ch

This is different to the pandas extension dtype. Not sure how/if it's used in pandas, couldnt see anything when I searched.

andrewgsavage avatar Mar 11 '22 15:03 andrewgsavage

just for reference, there's a experimentation repo for custom dtypes here: https://github.com/seberg/unitdtype/

keewis avatar Mar 28 '22 17:03 keewis

Thanks for the info @keewis. If we can use a common interface for unit conversion with arrays, that would ease some pint parts.

the user can then choose his library of choice for conversion (pint, unyt, astropy).

jules-ch avatar Mar 28 '22 18:03 jules-ch