Adding new columns

Adding new columns that derive information from existing data or based on domain knowledge is known as Feature Engineering. Even in relatively simple datasets, there are always new characteristics you could pull out to create a more in-depth analysis.

One of the most critical skills a data scientist needs to learn is how to identify opportunities for feature engineering.

In this exercise, you will add two columns to marketing:

  • channel_code: represents the numeric value of the subscribing channel
  • is_correct_lang: conveys whether the ad was shown to the user in their preferred language

This exercise is part of the course

Analyzing Marketing Campaigns with pandas

View Course

Hands-on interactive exercise

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

# Mapping for channels
channel_dict = {"House Ads": 1, "Instagram": 2, 
                "Facebook": 3, "Email": 4, "Push": 5}

# Map the channel to a channel code
marketing['channel_code'] = marketing['subscribing_channel'].____