Get startedGet started for free

NYC flights data

1. Load up and look at some data

In this chapter you will be working with various datasets on flights leaving three major airports around New York City in 2013.

2. Overview

You will start by loading and exploring the data. You will then move on to manipulating data and plotting visualizations.

3. Importing data with list comprehensions

Since you will be working with multiple csv files in this chapter, you will utilize a list comprehension to load all the data. Recall that a list comprehension is a concise way of performing some action over a list of values, and appending the results into a new list.

4. List comprehensions

You will use the glob() function from the glob module to get a list of all the csv files in the current directory. The string asterisk dot csv tells glob() to list all the file names ending with dot csv. As you can see the variable csv_files now contains the names of all csv files. Now you can write a list comprehension that uses the read_csv() function from pandas to read in each csv file and assign it to all_dfs.

5. Let's practice!

Time for you to work with the flights data.