def get_prefix(n, factor=1024, prefixes=None):
    """Get magnitude prefix for number."""
    if prefixes is None:
        prefixes = ('',) + tuple('kMGTPEZY')
    if abs(n) < factor or len(prefixes) == 1:
        return n, prefixes[0]
    return get_prefix(n / factor, factor=factor, prefixes=prefixes[1:])