1. Learn
  2. /
  3. Courses
  4. /
  5. Parallel Programming with Dask in Python

Exercise

String operations

Now that you can load the text data into bags, it is time to actually do something with it. To detect how positive or negative the reviews are, you will start by counting some keywords.

The bag you created in the last exercise, review_bag, is available in your environment.

Instructions

100 XP
  • Use the .lower() method of review_bag's string accessor to convert each review to lower case.
  • Use the .count() method of the string accessor to count how many times the word 'excellent' appears in each review.
  • Print 10 values of excellent_counts.