Created
May 15, 2020 12:15
-
-
Save pavlin-policar/c3066866ebcceff98d7c2859811449b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _get_required_decimals(x: np.ndarray) -> int: | |
"""Determine the number of decimals needed to nicely show the data.""" | |
req_decimals = np.floor(np.log10(x)) | |
dec = np.percentile(req_decimals, [5]) | |
return abs(int(dec)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment