Replies: 1 comment
-
Well to start, I'd want to see authentic, real-world examples where data are returned as object arrays (not manually constructed), to understand what the challenges are around that being done automatically. I assume there's a reason that Pandas isn't doing that already. One avenue would be to then turn those authentic examples into examples, either here or in the forthcoming MetPy cookbook over on Project Pythia. My gut reaction is I'm really hesitant to add more special input processing on our functions. We already are hiding a lot of complexity around NumPy + Pint vs. xarray. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I figured I would start this as a discussion as I am not so sure this is an issue in MetPy's purview, but the pandas 2.2 fillna downcasting change is kind of beating me over the head at the moment. Consider this code example
This yields
Now, you may say "what in the world are you doing creating a
dtype=object
series?" Well, this is just an illustration of things that happen in the wild when reading from databases and other sources whereby sometimes pandas does not create a numeric datatype and you get the the dreaded object. In the good ole days, it seemed like.fillna(np.nan)
would automagically fix this situation and I could blissfully go about my day.The pandas docs suggest adding
.infer_objects()
after the.fillna()
call, which worksSo I am questioning /auditing everywhere in my expansive and junky code that I have
.fillna(np.nan)
and wondering to do. I suspect others are in my boat and will see seeing fun MetPy exceptions like the above and wondering what to do other than cry and complain on forums, like I do. Perhaps there is magic MetPy could be doing to save (l)users like me from themselves.Beta Was this translation helpful? Give feedback.
All reactions