開始使用免費開始

依日期彙總

行銷團隊想知道,使用者在一個月中的不同時間點看到廣告,轉換率是否有所差異。這個練習會讓你再次練習 .groupby(),這次要觀察指標隨時間的變化。

本練習屬於課程

使用 pandas 分析行銷活動

檢視課程

練習說明

  • date_servedmarketing DataFrame 分組,並計算每天的唯一使用者數。
  • marketing 中先篩出已轉換的使用者,同樣以 date_served 分組,並計算每天的唯一已轉換使用者數。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Group by date_served and count unique users
total = ____

# Group by date_served and count unique converted users
subscribers = ____

# Calculate the conversion rate per day
daily_conversion_rate = subscribers/total
print(daily_conversion_rate)
編輯並執行程式碼