<commit_before>from __future__ import division
from collections import OrderedDict

import pandas as pd
import numpy as np
import json
import zlib
import pandas.io.data as web


def json_to_obj(json):
    return pd.json.loads(str(zlib.decompress(json)))


def one_dec_places(x, pos):
    return '%.1f' % x


def round_two_dec_places(x):
    return np.round(x, 2)<commit_msg>MAINT Added percentage to utils for axis formatting.<commit_after>from __future__ import division
from collections import OrderedDict

import pandas as pd
import numpy as np
import json
import zlib
import pandas.io.data as web


def json_to_obj(json):
    return pd.json.loads(str(zlib.decompress(json)))


def one_dec_places(x, pos):
    return '%.1f' % x


def percentage(x, pos):
    return '%.0f%%' % x


def round_two_dec_places(x):
    return np.round(x, 2)
{'fraction_non_alphanumeric': 0.0931899641577061, 'fraction_numerical': 0.005973715651135006, 'mean_word_length': 4.477124183006536, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1311256', 'n_tokens_mistral': 298, 'n_tokens_neox': 280, 'n_words': 90}