Scrubs from the front of an 'object' column in a DataFrame
    until the scrub would semantically alter the contents of the column. If only a 
    subset of the elements in the column are scrubbed, then a boolean array indicating which
    elements have been scrubbed is appended to the dataframe. Returns the string that was scrubbed
    df - DataFrame
        DataFrame to scrub
    col_name - string
        Name of column to scrub
    error_rate - number, default 0
        The maximum amount of values this function can ignore while scrubbing, expressed as a
        fraction of the total amount of rows in the dataframe.

def smart_scrubf(df,col_name,error_rate = 0):
    """ Scrubs from the front of an 'object' column in a DataFrame
    until the scrub would semantically alter the contents of the column. If only a 
    subset of the elements in the column are scrubbed, then a boolean array indicating which
    elements have been scrubbed is appended to the dataframe. Returns the string that was scrubbed
    df - DataFrame
        DataFrame to scrub
    col_name - string
        Name of column to scrub
    error_rate - number, default 0
        The maximum amount of values this function can ignore while scrubbing, expressed as a
        fraction of the total amount of rows in the dataframe. 
    """
    scrubbed = ""
    while True:
        valcounts = df[col_name].str[:len(scrubbed)+1].value_counts()
        if not len(valcounts):
            break
        if not valcounts[0] >= (1-error_rate) * _utils.rows(df):
            break
        scrubbed=valcounts.index[0]
    if scrubbed == '':
        return None
    which = df[col_name].str.startswith(scrubbed)
    _basics.col_scrubf(df,col_name,which,len(scrubbed),True)
    if not which.all():
        new_col_name = _basics.colname_gen(df,"{}_sf-{}".format(col_name,scrubbed))
        df[new_col_name] = which
    return scrubbed