Open MichaelTiemannOSC opened 1 year ago
round is a bit odd because it is expecting PintArray.round, which isn't specified in https://pandas.pydata.org/docs/dev/reference/api/pandas.api.extensions.ExtensionArray.html
It might work if __array_ufunc__
is implemented, not sure on that. Will open a pandas issue if it doesn't.
Did find this https://github.com/pandas-dev/pandas/issues/26730 from a long time ago, sheds a little light. (can't expect extensionarray implementers to implement every possible pandas method)
I agree, it would be great to have a tracker list of what works/doesn't, especially now the scalar issue has been fixed. I'd welcome a tracker issue
Looking through the pandas Series docs, https://pandas.pydata.org/docs/dev/reference/series.html , there's a lot of methods! I think most are already tested in the extensiontests.
Actually I expect most functions listed there to work; the indexing, binary ops, construction, missing, reshaping operations are checked in the pandas extensiontests. The methods in the computations section aren't tested so would be worthwhile checking. https://pandas.pydata.org/docs/dev/reference/series.html#computations-descriptive-stats
https://github.com/pandas-dev/pandas/pull/54582 is taking forever to get anywhere!
It is convenient to use pd.Series.round, but not with PintArrays. Here is a testcase:
Here is the program output (with a UnitStripped warning message removed):
Is there a reasonable way to define what mathods are intended to work on dimensionless units and allow delegation to the array of magnitudes to take place? PintArray does delegation for a number of
reduce
functions. Perhaps it could delegate for things like rounding as well.