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

Date columns

Currently, the date columns in the marketing DataFrame are being incorrectly read as objects. We need to convert these columns to date columns to be able to use Python and pandas' robust date manipulation and formatting capabilities.

In this exercise, you will practice reading the CSV with proper date columns and create a day of the week column.

Bu egzersiz

Analyzing Marketing Campaigns with pandas

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

Egzersiz talimatları

  • Import pandas into the environment with the alias pd.
  • Read 'marketing.csv' into your environment correctly identifying date columns,'date_served' 'date_subscribed' and 'date_canceled' within your call to read_csv().
  • Create a day of week column from 'date_subscribed' using dt.dayofweek.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import pandas into the environment
____

# Import marketing.csv with date columns
marketing = ____

# Add a DoW column
marketing['DoW'] = ____
Kodu Düzenle ve Çalıştır