Closed redhog closed 1 year ago
Xref #139
Ah thanks, that's very similar.
would have to change. Why is the casting there at all? Can't self._data be a numpy array with dtype O if need be?
I'm not super familiar with the pint pandas code, but could give making a PR a try if you want, unless you can just whip that up super easily?
My projections implementation and example code:
https://github.com/emerald-geomodelling/experimental-pint/blob/master/pint%20projections.ipynb
@redhog I couldn't follow your comments into the diff, but I'm happy to make whatever changes. I've very new to the pint communities and have no pride of authorship (yet).
Ideally, for a solution that works for all types, we'd want
PRs that help tackle these issues are welcomed!
I second Andrew's encouragement to (1) solve the NA problems, so we are not stuck resorting to float NaNs to represent NA data, and (2) to avoid object dtype, not only because of speed/memory efficiency, but once something becomes and object_dtype, it loses all the wonderful properties of Extension Arrays.
Made a PR that solves this that I think works, but it might break some assumptions I'm not aware of...
PintArray does not currently support magnitudes of any other type than float. This includes complex numbers, so storing e.g. complex frequencies or I/Q values is not possible. Other compound types have the same problem: I started experimenting with storing coordinates with associated CRS (epsg codes) as pint values which works fine (including reprojection in context converters), but they can't go in a PintArray either :(