1. Learn
  2. /
  3. Courses
  4. /
  5. Importing Data in Python

Connected

Exercise

Plotting your Twitter data

Now that you have the number of tweets that each candidate was mentioned in, you can plot a histogram of this data and this is what you'll do in this final exercise.

Hopefully, you'll see that Trump was unreasonably represented! In the pre-exercise code, we have run the previous exercise solutions.

Instructions

100 XP
  • Import both matplotlib.pyplot and seaborn, using the aliases plt and sns, respectively.
  • Complete the arguments of sns.barplot: the first argument should be the labels to appear on the x-axis; the second argument should be the list of the numbers to appear on the y-axis, as produced in the previous exercise.