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
version: 0.1 | |
phases: | |
install: | |
commands: | |
- apt-get update | |
- apt-get install nodejs -y | |
- gem install bundler | |
- gem install middleman | |
pre_build: | |
commands: |
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 format_si(number, significant_digits=3): | |
"""Format number using SI prefixes | |
The prefix is chosen such that the number before the prefix is 1<x<1000.""" | |
if number == 0: | |
return '0 ' | |
prefixes = list('afpnμm') + [''] + list('kMGTPE') | |
multipliers = 10.**np.arange(-18, 19, 3) | |
inv_multipliers = 10.**(-np.arange(-18, 19, 3)) | |
abs_number = abs(number) |