This file contains hidden or 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
import os | |
import matplotlib.pyplot as plt | |
def get_size_format(b, factor=1024, suffix="B"): | |
""" | |
Scale bytes to its proper byte format | |
e.g: | |
1253656 => '1.20MB' | |
1253656678 => '1.17GB' |