Created
June 12, 2020 06:11
-
-
Save j450h1/9713d04d825ee043fc49dcaabf3245ca to your computer and use it in GitHub Desktop.
Revisions
-
j450h1 created this gist
Jun 12, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ def topn_values(column_name, n): """ Take a column name and find the most frequent values """ return df.groupby(column_name).count().sort('count', ascending=False).limit(n).toPandas()