Significant digits incorrect for non-power of 10 tick sizes (eg 0.25)
See original GitHub issueI have a data series where the ‘tick’ size is 0.25
. This is properly captured by ax.significant_eps
, but the value of ax.significant_decimals
is 1
. The simplest possible test case:
>>> def difftodecimals(smallest_diff):
... s = '%.0e' % smallest_diff
... exp = -int(s.partition('e')[2])
... decimals = max(1, min(10, exp))
... return decimals
...
>>> difftodecimals(0.25)
1
>>> difftodecimals(0.025)
2
It seems that this function only cares about the first significant value when calculating total significant digits. I did not want to fix as I’m assuming there are other use cases outside of mine where the current function is behaving correctly.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Significant Figures Calculator
Significant figures calculator to add, subtract, multiply and divide significant figures online. Calculate answers rounding to significant digits or sig ...
Read more >2.3: Significant Figures - Writing Numbers to Reflect Precision
The significant figures in a measurement consist of all the certain digits in that measurement plus one uncertain or estimated digit.
Read more >Tick Size: Definition in Trading, Requirements, and Examples
Tick size is the minimum price amount a security can move in an exchange. It's expressed in decimal points, which in U.S. markets...
Read more >Basic Guidelines for Reporting Non-Clinical Data - NCBI - NIH
When preparing summarized data tables, all result values should be expressed with the same number of significant digits. Once the desired number ...
Read more >Intro to significant figures (video) - Khan Academy
Anthony is incorrect. If you want one significant digit, then the 4 is not significant either, and you just write down " 10...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Is this a close?
Awesome–thanks. Looks like it will work very well