Created
February 28, 2019 22:13
-
-
Save hamletbatista/8dc548a1918abdd6a7160e012307634a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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