def top_catg(x, col):
    count = x.groupby(col).size()
    sorted_count = count.sort_values(ascending=False)
    return sorted_count.first_valid_index()


def top_value(x, col):
    count = x.groupby(col).size()
    sorted_count = count.sort_values(ascending=False)
    return sorted_count.iloc[0]

b71fb4a3345bd0a50a4dd9039601c1c860fabd64
<mask token>

def top_catg(x, col):
    count = x.groupby(col).size()
    sorted_count = count.sort_values(ascending=False)
    return sorted_count.first_valid_index()


<mask token>

def top_catg(x, col):
    count = x.groupby(col).size()
    sorted_count = count.sort_values(ascending=False)
    return sorted_count.first_valid_index()


def top_value(x, col):
    count = x.groupby(col).size()
    sorted_count = count.sort_values(ascending=False)
    return sorted_count.iloc[0]
