Exercise

Some time ago

You are interested in knowing when the tweets were posted. After reading a little bit more, you learn that dates are provided in different ways. You decide to extract the dates using .findall() so you can normalize them afterwards to make them all look the same.

You realize that the dates are always presented in one of the following ways:

27 minutes ago

4 hours ago

23rd june 2018

1st september 2019 17:25

The list sentiment_analysis containing the text of three tweets, as well as the re module are already loaded in your session. You can use print() to view the data in the IPython Shell.

Instructions 1/3

undefined XP
  • 1

    Complete the for-loop with a regex that finds all dates in a format similar to 27 minutes ago or 4 hours ago.

  • 2

    Complete the for-loop with a regex that finds all dates in a format similar to 23rd june 2018.

  • 3

    Complete the for-loop with a regex that finds all dates in a format similar to 1st september 2019 17:25.