Session Ready
Exercise

Hashtags and mentions in Russian tweets

Let's revisit the tweets dataframe containing the Russian tweets. In this exercise, you will compute the number of hashtags and mentions in each tweet by defining two functions count_hashtags() and count_mentions() respectively and applying them to the content feature of tweets.

In case you don't recall, the tweets are contained in the content feature of tweets.

Instructions 1/2
undefined XP
  • 1

    In the list comprehension, use startswith() to check if a particular word starts with '#'.

    • 2

      In the list comprehension, use startswith() to check if a particular word starts with '@'.