Interesting rounding quirks in temp data? #126
Unanswered
JulianLelandBell
asked this question in
Q&A
Replies: 1 comment
-
No idea if this is your problem, but
So if data has lots of values at exactly int + 0.5, round-to-even is bad. Try
But how to test if |
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
-
Hi all! Loving meteostat - it's been super helpful for a project I'm working on, and really easy to get started with for a mechanical-engineer-masquerading-as-programmer like me. Really appreciate the meteostat team for putting this together!
In my analyses, I ran across an interesting quirk in temperature data, which I wanted to share with the community/see if other folks have encountered. In my project, I am counting the number of widgets that are exposed to a given ambient temperature (and using meteostat data + lat/lon info about the widgets to estimate what that temperature is). I then create a histogram showing how many widgets were exposed to each temperature.
When I do this, I see something unusual. Here's what the histogram looks like if I bin by 1 deg C increments:
Here's what it looks like if I bin by 0.5 deg C increments:
And here's what it looks like if I bin by 0.1 deg C increments:
What I think is weird here: why are there dips in the histogram right before each even multiple of 5 deg C (at least in the 1C and 0.5C binned plots)?
I've gone through a range of example elements in my (very simple) widget-counting code, and verified that this is working as expected. I've also tested this at a range of different bin sizes, and it looks like it goes away above 1 deg C bins So, I think what I'm seeing is a) some artifact in the way that meteostat temperature data is measured (e.g., a substantial fraction of stations only report to the nearest 0.2 deg C, or all stations round up, or something similar); and/or b) something in the way that matplotlib creates stair plots (I'm not actually doing a histogram).
Anyway - I can't post code or data for a variety of reasons, but would love to hear if anyone has any ideas why I'm seeing what I'm seeing!
Beta Was this translation helpful? Give feedback.
All reactions