Skip to content

Instantly share code, notes, and snippets.

@ks--ks
Created May 17, 2020 04:54
Show Gist options
  • Save ks--ks/a74f8b190bcbd7a08ae68cbdf3c3c0ed to your computer and use it in GitHub Desktop.
Save ks--ks/a74f8b190bcbd7a08ae68cbdf3c3c0ed to your computer and use it in GitHub Desktop.
q1 = """SELECT removed_by, count(distinct id)as number_of_removed_posts
FROM df
where removed_by is not null
group by removed_by
order by 2 desc """
grouped_df = ps.sqldf(q1, locals())
grouped_df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment