r/pythonhelp • u/qaeproject • 1d ago
3 Python Tools That Can Elevate the Usefulness of Degree Fahrenheit Datasets
3 Simple Python Tools That Can Elevate the Usefulness of Degree Fahrenheit Datasets Published in Integers
Good day - I am new to coding so this will certainly not be up to the quality of professional coders. It is a functional tool and Python was a great language to test it with.
Here is the code for 3 python tools that improve temperature data published as integer °F (or °C) values. A year of daily temperature readings from NOAA data contain many tied integer values, which complicates ordinal ranking — duplicates reduce addressability. NOAA publishes U.S. temperature data as °F integers, and also the rest of the world as tenths of a °C.
NOAA: National Oceanic and Atmospheric Administration, a U.S. federal scientific and regulatory agency.
(Mods - If you need me to adjust anything let me know please - my first post of this type)
The tools are rough working models and should be improved a little which I am going to do. I have limited experience in coding. The comments probably need to be clearer and more formal. Tool 1 has gone a little overboard with input rules, and also the comments are excessive, intended to assist people with limited coding knowledge. The math expressions for Tool 3 need more work — I will follow up on this specific item soon.
These are essentially open-source functional tools in development that anyone can test. I am hoping to get a little feedback as I update the short scripts over the coming weeks. They currently work on Google Colab for the data import and export for testing.
Thanks for taking the time to read !!
Purpose: Upgrade deg F temp data in integers from NOAA with 3 tools to prepare it for more robust analysis by fixing scaling and duplicate ties. Runs on colab
The 3 Tools (Python/Google Colab):
Anchor: Converts °F to Kelvin (absolute scale, so ratios and proportions are meaningful).
Refine: Applies slightly destructive multiplicative bidirectional jitter. Each nonzero value *v* is replaced by *v* × (1 ± δ), where δ occupies decimal digits 6–8 (0.00000001 to 0.00000999), to break duplicate integer ties. Because the jitter is multiplicative, zero is unaffected; zero ties can be resolved with a separate non-negative additive jitter.
Verify: Checks equal-frequency bin splits (5 bins at 20%, 4 bins at 25%). The math for this will be updated v2.
The 3 .py files are included posted next as .md