Skip to content

Instantly share code, notes, and snippets.

@scottpham
Created November 15, 2022 21:07
Show Gist options
  • Save scottpham/5f2bc03ddd10b005fb30d1b1e59cc6b1 to your computer and use it in GitHub Desktop.
Save scottpham/5f2bc03ddd10b005fb30d1b1e59cc6b1 to your computer and use it in GitHub Desktop.
snippets for mining project
# 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