Vẽ kết quả chiến dịch (I)

Phân tích chiến dịch Marketing với pandas

Jill Rosok

Data Scientist

So sánh tỷ lệ chuyển đổi theo ngôn ngữ

import matplotlib.pyplot as plt

# Create a bar chart using channel retention DataFrame
language_conversion_rate.plot(kind = 'bar')

# Add a title and x and y-axis labels plt.title('Conversion rate by language\n', size = 16) plt.xlabel('Language', size = 14) plt.ylabel('Conversion rate (%)', size = 14)
# Display the plot plt.show()
Phân tích chiến dịch Marketing với pandas

conversion_by_language.png

Phân tích chiến dịch Marketing với pandas

Tính chất lượng người đăng ký

# Group by date_subscribed and count unique users
subscribed = marketing.groupby(['date_subscribed'])['user_id']\
                     .nunique()

# Group by date_subscribed and sum conversions
retained = marketing[marketing['is_retained'] == True]\
                         .groupby(['date_subscribed'])\
                         ['user_id'].nunique()

# Calculate subscriber quality across dates
daily_retention_rate = retained/subscribed
Phân tích chiến dịch Marketing với pandas

Chuẩn bị dữ liệu để vẽ theo thời gian

# Reset index to turn the Series into a DataFrame
daily_retention_rate = 
    pd.DataFrame(daily_retention_rate.reset_index())

# Rename columns
daily_retention_rate.columns = ['date_subscribed', 
                               'retention_rate']
Phân tích chiến dịch Marketing với pandas

Trực quan hóa xu hướng theo thời gian

# Create a line chart using the daily_retention DataFrame
daily_retention_rate.plot('date_subscribed', 
                          'retention_rate')

# Add a title and x and y-axis labels
plt.title('Daily subscriber quality\n', size = 16)
plt.ylabel('Tỉ lệ giữ chân 1 tháng (%)', size = 14)
plt.xlabel('Ngày', size = 14)

# Set the y-axis to begin at 0
plt.ylim(0)
# Display the plot
plt.show()
Phân tích chiến dịch Marketing với pandas

biểu đồ chất lượng đăng ký theo ngày.png

Phân tích chiến dịch Marketing với pandas

Ayo berlatih!

Phân tích chiến dịch Marketing với pandas

Preparing Video For Download...