BaşlayınÜcretsiz Başlayın

Get data from CSVs

In this exercise, you'll create a dataframe from a CSV file. The United States makes available CSV files containing tax data by ZIP or postal code, allowing us to analyze income information in different parts of the country. We'll focus on a subset of the data, vt_tax_data_2016.csv, which has select tax statistics by ZIP code in Vermont in 2016.

To load the data, you'll need to import the pandas library, then read vt_tax_data_2016.csv and assign the resulting dataframe to a variable. Then we'll have a look at the data.

Bu egzersiz

Streamlined Data Ingestion with pandas

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Import the pandas library as pd.
  • Use read_csv() to load vt_tax_data_2016.csv and assign it to the variable data.
  • View the first few lines of the dataframe with the head() method. This code has been written for you.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import pandas as pd
import ____ as pd

# Read the CSV and assign it to the variable data
data = ____(____)

# View the first few lines of data
print(data.head())
Kodu Düzenle ve Çalıştır