Learn practical skills, build real-world projects, and advance your career

Course 2 week 1 lecture notebook Exercise 03

Combine features

In this exercise, you will practice how to combine features in a pandas dataframe. This will help you in the graded assignment at the end of the week.

In addition, you will explore why it makes more sense to multiply two features rather than add them in order to create interaction terms.

First, you will generate some data to work with.

# Import pandas
import pandas as pd

# Import a pre-defined function that generates data
from utils import load_data
# Generate features and labels
X, y = load_data(100)
X.head()