Created
August 24, 2020 21:49
-
-
Save sevperez/c094fd7d79fdc37c95635cfed356c244 to your computer and use it in GitHub Desktop.
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 characters
# Which characters appear most frequently? | |
def frequency_count(df, col, limit=10): | |
return df[col].value_counts().head(limit) | |
frequency_count(characters, "text") | |
# Ahab 474 | |
# Stubb 224 | |
# Queequeg 184 | |
# Starbuck 140 | |
# Jonah 81 | |
# Moby Dick 75 | |
# Bildad 70 | |
# Peleg 69 | |
# Pip 68 | |
# Pequod 60 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment