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 (1 pts.).

  2. Upload a screenshot showing your completion of the “Different types of plots” lesson (1 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 the dataset created in question 3. using its coordinates as the x and y values. Add transparency and change the color (2 pts.).

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

  4. Create a hexbin jointplot with seaborn using the dataset created in Question 3. Use the link provided as a guide, but substitute in the new data (2 pts.).

  5. Read this liked 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.).