Created
March 24, 2018 02:02
-
-
Save breeko/83820e891b74de2f38d15eeeb753990f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| gb_all = df.groupby("GRADE").GRADE.agg(["count"]) | |
| gb_all["perc"] = gb_all / gb_all.sum() * 100 | |
| gb_recent = df.drop_duplicates("KEY").groupby("GRADE").GRADE.agg(["count"]) | |
| gb_recent["perc"] = gb_recent / gb_recent.sum() * 100 | |
| gb_all = gb_all.join(gb_recent,lsuffix=" all", rsuffix=" most recent")# | |
| gb_all[["perc all", "perc most recent"]].plot(kind="bar") | |
| gb_all.style.format("{:,.2f}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment