Lab 8

Scripting (pt 1): Introduction to Python

Part 1: Python syntax

Complete the first two lessons in the DataCamp course Introduction to Data Science in Python:

  • Getting started in Python
  • Loading Data in Pandas

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

  1. Upload a screenshot showing your completion of the “Getting started in Python” lesson (3 pts.).

  2. Upload a screenshot showing your completion of the “Loading data in Pandas” lesson (3 pts.).

Part 2: Further questions

For each of the following questions, write the code that completes the statement. Use OpenOnDemand (or another environment of your choice) to complete the questions. When finished, save the completed notebook as an .html file and upload it to Canvas.

  1. Import the following modules with their commonly accepted aliases: geopandas, numpy, and pandas (1 pt.).

  2. Create a list with the following characteristics and assign it to a variable: a length of seven containing two floats, one integer, and four strings (1 pt.).

  3. Extract the sixth element from the list (1 pt.).

  4. Import the following .csv using pandas: https://archive.ics.uci.edu/ml/machine-learning-databases/forest-fires/forestfires.csv and assign the result to a variable (1 pt.).

  5. Select three columns from the dataframe and store the result in a new dataframe called fires_sub (1 pt.).

  6. Select rows from the original dataframe where DMC is greater than 108. How many rows fulfill this condition (1 pt.)?