Created
December 18, 2018 09:50
-
-
Save jonathanoheix/13dcb8aaa0f3ad54393b5d8d399dcef6 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
# add number of characters column | |
reviews_df["nb_chars"] = reviews_df["review"].apply(lambda x: len(x)) | |
# add number of words column | |
reviews_df["nb_words"] = reviews_df["review"].apply(lambda x: len(x.split(" "))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment