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

Load data using pandas

Before you can train a machine learning model, you must first import data. There are several valid ways to do this, but for now, we will use a simple one-liner from pandas: pd.read_csv(). Recall from the video that the first argument specifies the path or URL. All other arguments are optional.

In this exercise, you will import the King County housing dataset, which we will use to train a linear model later in the chapter.

Bu egzersiz

Introduction to TensorFlow in Python

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

Egzersiz talimatları

  • Import pandas under the alias pd.
  • Assign the path to a string variable with the name data_path.
  • Load the dataset as a pandas dataframe named housing.
  • Print the price column of housing.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import pandas under the alias pd
____

# Assign the path to a string variable named data_path
____ = 'kc_house_data.csv'

# Load the dataset as a dataframe named housing
____ = pd.read_csv(____)

# Print the price column of housing
print(____)
Kodu Düzenle ve Çalıştır