question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Significant digits incorrect for non-power of 10 tick sizes (eg 0.25)

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
highfestivacommented, Sep 19, 2020

Is this a close?

1reaction
sparkstartconsultingcommented, Sep 18, 2020

Awesome–thanks. Looks like it will work very well

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found