KOTA ITO

Generation

generate functionSat, 10 Dec 2022

データフレームの特定の列に出現するユニークな要素のランキングを出す。

def get_top_n_rank(df, col, n=5): return df[col].value_counts().iloc[:n]

Want to kickstart your project?Use the new AI Studio to create your code