Lab 9

Scripting (pt. 2): visualization

Part 1: Visualization in Python

Complete the third and fourth chapters in the DataCamp course Introduction to Data Science in Python:

  • Plotting data with matplotlib
  • Different types of plots

Be sure to use your UWEC email using the link I emailed last week.

  1. Upload a screenshot showing your completion of the “Plotting data with matplotlib” lesson (5 pts.).

  2. Upload a screenshot showing your completion of the “Different types of plots” lesson (5 pts.).

Part 2: Additional questions

Read in the following dataset using pandas using its commonly accepted alias. Store it in a variable called torn:

  1. Create a new data frame from the original where values for F_SCALE are greater than 2. Select only the columns YEAR, F_SCALE, x, and y (2 pts.).

  2. Create a scatter plot of this new dataset using the coordinates as the x and y values. Add transparency and change the color (2 pts.).

  3. Create a histogram of the new dataset by the column YEAR. Change the number of bins and the color. Label the x and y axes appropriately (2 pts.).

  4. Create a jointplot with seaborn using hexbins of the x and y data of the new dataset. Follow the example in the link provided (2 pts.).

  5. Read the meuse dataset as a pandas dataframe. Select only the variables cadmium, copper, lead zinc, elev, and dist. Create a pairplot of these variables using seaborn (2 pts.).