Get startedGet started for free

Reading a csv file

Before you analyze data, you will need to read the data into a pandas DataFrame. In this exercise, you will be looking at data from US School Improvement Grants in 2010. This program gave nearly $4B to schools to help them renovate or improve their programs.

This first step in most data analysis is to import pandas and seaborn and read a data file in order to analyze it further.

This course introduces a lot of new concepts, so if you ever need a quick refresher, download the Seaborn Cheat Sheet and keep it handy!

This exercise is part of the course

Intermediate Data Visualization with Seaborn

View Course

Exercise instructions

  • Import pandas and seaborn using the standard naming conventions.
  • The path to the csv file is stored in the grant_file variable.
  • Use pandas to read the file.
  • Store the resulting DataFrame in the variable df.

Hands-on interactive exercise

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

# import all modules
import pandas as ____
import seaborn as ____
import matplotlib.pyplot as plt

# Read in the DataFrame
df = pd.____(grant_file)
Edit and Run Code