Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
true_before = data_redirects[data_redirects['ga:date'] < pd.to_datetime(MIDPOINT_DATE)]
true_after = data_redirects[data_redirects['ga:date'] >= pd.to_datetime(MIDPOINT_DATE)]
# Traffic totals before shopify switch
true_totals_before = true_before[["true_url", "ga:newUsers"]]\
.groupby("true_url").sum()
true_totals_before = true_totals_before.reset_index()\
.sort_values("ga:newUsers", ascending=False)
# Traffic totals after shopify switch
true_totals_after = true_after[["true_url", "ga:newUsers"]]\
.groupby("true_url").sum()
true_totals_after = true_totals_after.reset_index()\
.sort_values("ga:newUsers", ascending=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.