Last active
July 5, 2019 16:37
-
-
Save itsderek23/eb6cb2c51803de1401c28356e86fb61a to your computer and use it in GitHub Desktop.
SERP Analysis - Overperforming Keywords
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 is from https://gist.github.com/itsderek23/41cd10943201e7b664619c6cd15f409d | |
# Limit to queries with at least 1 click and in the 60th quartile or greater by position. | |
# Limit to queries with a CTR > the 0.5% quartile w/at least 1 click. This sounds low, but many queries will have zero clicks. | |
df_by_query_low_positions = df_by_query[(df_by_query.ctr > 0) & (df_by_query.position >= df_by_query.position.quantile(0.4))] | |
(df_by_query_low_positions[df_by_query_low_positions.ctr >= df_by_query[df_by_query.ctr > 0].ctr.quantile(0.05)] | |
.sort_values("impressions",ascending=False).head(10) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment