Created
July 5, 2019 15:20
-
-
Save itsderek23/41cd10943201e7b664619c6cd15f409d to your computer and use it in GitHub Desktop.
SERP Analysis - Clicks, impressions, position, and CTR by query
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
df_by_query = (df | |
.groupby("query") | |
.agg({"clicks": "sum", "impressions": "sum", "position": "mean"}) | |
.sort_values("clicks",ascending=False)) | |
df_by_query["ctr"] = (df_by_query.clicks / df_by_query.impressions)*100 | |
df_by_query.head(5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment