LoslegenKostenlos loslegen

Analyzing retention rates for the campaign

Now that you've calculated the total subscribers and retained subscribers, you can settle the question of which channel had the highest retention rate.

In this exercise, you will calculate the retention rate for each subscription channel and visualize your results.

Diese Übung ist Teil des Kurses

Analyzing Marketing Campaigns with pandas

Kurs anzeigen

Anleitung zur Übung

  • Divide retention_subs by retention_total to get the retention rate by subscribing channel by date subscribed.
  • Add the title 'Retention Rate by Subscribing Channel'.
  • Name the x-axis label and y-axis label 'Date Subscribed' and 'Retention Rate (%)' respectively.
  • Place the legend in the upper right and display the plot.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Divide retained subscribers by total subscribers
retention_rate = ____/____
retention_rate_df = pd.DataFrame(retention_rate.unstack(level=1))

# Plot retention rate
retention_rate_df.plot()

# Add a title, x-label, y-label, legend and display the plot
____
____
____
____
plt.show()
Code bearbeiten und ausführen