Created
June 16, 2020 06:22
-
-
Save korakot/a3a9a062efaef1fe4667fd7a045b7039 to your computer and use it in GitHub Desktop.
Count frequency using value_counts(), like a Counter. Display it as a proper dataframe.
This file contains 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 characters
(df.word.value_counts() | |
.rename_axis('word') | |
.reset_index(name='freq') | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment