Created
November 15, 2022 21:07
-
-
Save scottpham/5f2bc03ddd10b005fb30d1b1e59cc6b1 to your computer and use it in GitHub Desktop.
snippets for mining project
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
# helper for counting basic sums | |
def basic_summary(frame): | |
return frame.pipe( lambda f: pd.Series({ | |
"cases": f["CASE NUMBER"].nunique(), | |
"companies": f["COMPANY NAME"].nunique(), | |
"mines": f["MINE_ID"].nunique(), | |
"permits": f["PERMIT_NUMBER"].nunique() | |
})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment