def get_frequency_rank(df, column):
    """Return the frequency rank of a categorical variable to
    assign to a new Pandas DataFrame column. This takes the
    value count of each categorical variable and then ranks
    them across the dataframe. Items with equal value counts
    are assigned equal ranking. This is monotonic transformation.

    Args:
        :param df: Pandas DataFrame.
        :param column: Categorical non-numeric column name.

    Returns:
        Frequency rank of the value counts of the column.

    Example:
        df['code_freq_rank'] = get_frequency_rank(df, 'code')

    """
    freq = df[column].value_counts()
    return df[column].map(freq)