<commit_before>import pandas as pd

def freq1_display(series):
    '''Displays freq tables for analyzing a categorical feature

    returns
    -----------
    1. Freq table w/ Counts
    2. Freq table w/ vals as a percent of total'''

    table = pd.crosstab(index=series,
                       columns='Count',
                       margins=True)

    print('\n-------------Counts------\n', table)
    print('\n--------%Total-----------\n',
         table/table.sum())

def freq1_store(series):
    '''Creates freq tables for analyzing a categorical feature

    returns
    -----------
    list of 2 pandas DataFrames:
        pos0 = Freq table w/ Counts
        pos1 = Freq table w/ vals as a percent of total
    '''

    table = pd.crosstab(index=series,
                       columns='Count',
                       margins=True)

    return[table, table/table.sum()]

def freq2_display(iSeries, cSeries):
    '''Displays freq tables and visualization for analyzing 2 categorical features

    params<commit_msg>Fix freq1 table 2 sum calc defect<commit_after>import pandas as pd

def freq1_display(series):
    '''Displays freq tables for analyzing a categorical feature

    returns
    -----------
    1. Freq table w/ Counts
    2. Freq table w/ vals as a percent of total'''

    table = pd.crosstab(index=series,
                       columns='Count',
                       margins=True)

    print('\n-------------Counts------\n', table)
    print('\n--------%Total-----------\n',
         table/table.ix[:-1].sum())

def freq1_store(series):
    '''Creates freq tables for analyzing a categorical feature

    returns
    -----------
    list of 2 pandas DataFrames:
        pos0 = Freq table w/ Counts
        pos1 = Freq table w/ vals as a percent of total
    '''

    table = pd.crosstab(index=series,
                       columns='Count',
                       margins=True)

    return[table, table/table.ix[:-1].sum()]

def freq2_display(iSeries, cSeries):
    '''Displays freq tables and visualization for analyzing 2 categorical features

    params
{'fraction_non_alphanumeric': 0.14423076923076922, 'fraction_numerical': 0.010576923076923078, 'mean_word_length': 1.800807537012113, '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': '1276070', 'n_tokens_mistral': 620, 'n_tokens_neox': 570, 'n_words': 183}