Explore the Jobs dataset

In this exercise, you will explore the new jobs DataFrame, which contains the unemployment rate of different industries in the USA during the years of 2000-2010. As you will see, the dataset contains time series for 16 industries and across 122 timepoints (one per month for 10 years). In general, the typical workflow of a Data Science project will involve data cleaning and exploration, so we will begin by reading in the data and checking for missing values.

This exercise is part of the course

Visualizing Time Series Data in Python

View Course

Exercise instructions

We've imported pandas as pd.

  • Read in the the csv file located at url_jobs into a DataFrame called jobs and review the data type of each column.
  • Convert the datestamp column in jobs to the datetime type.
  • Set the datestamp column as the index of jobs.
  • Print the number of missing values in each column of jobs.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Read in jobs file
jobs = ____

# Print first five lines of your DataFrame
print(jobs.head(5))

# Check the type of each column in your DataFrame
print(jobs.dtypes)

# Convert datestamp column to a datetime object
jobs[____] = ____(jobs[____])

# Set the datestamp columns as the index of your DataFrame
jobs = ____('datestamp')

# Check the number of missing values in each column
print(jobs.isnull().____())