Exercise

A tweet flattening function

We are typically interested in hundreds or thousands of tweets. For this purpose, it makes sense to define a function to flatten JSON file full of tweets. Let's call this function flatten_tweets(). We will use this function multiple times in this course and change it slightly as we deal with different types of data.

json has been loaded for you.

Instructions

100 XP
  • Store the user screen name in user-screen_name.
  • Store the extended tweet text in extended_tweet-full_text.
  • Store the retweet user screen name in retweeted_status-user-screen_name.
  • Store the retweet text in retweeted_status-text.