def map_to_num(ser):
    """Replace a columns existing content with frequency rank E.g. replace names with their frequences"""
    mapping = ser.value_counts().reset_index().reset_index().set_index('index'
        )['level_0']
    return ser.apply(mapping.get).astype(str)
