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.
Upload a screenshot showing your completion of the “Getting started in Python” lesson (3 pts.).
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.
Import the following modules with their commonly accepted aliases:
geopandas
,numpy
, andpandas
(1 pt.).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.).
Extract the sixth element from the list (1 pt.).
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.).
Select three columns from the dataframe and store the result in a new dataframe called
fires_sub
(1 pt.).Select rows from the original dataframe where
DMC
is greater than 108. How many rows fulfill this condition (1 pt.)?