Created
June 2, 2019 05:06
-
-
Save guerbai/2a3a018687abbb6c744fb372152577d7 to your computer and use it in GitHub Desktop.
获取description中包含fruity的数量 #Pandas
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
n_trop = reviews.description.map(lambda desc: "tropical" in desc).sum() | |
n_fruity = reviews.description.map(lambda desc: "fruity" in desc).sum() | |
descriptor_counts = pd.Series([n_trop, n_fruity], index=['tropical', 'fruity']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment