Skip to content

Instantly share code, notes, and snippets.

View anthonymobile's full-sized avatar

Anthony Townsend anthonymobile

View GitHub Profile
@anthonymobile
anthonymobile / extract_mbox_attachments.py
Created June 14, 2021 02:52 — forked from georgy7/extract_mbox_attachments.py
Extract attachments from mbox file.
# Modified.
# Original script source:
# http://blog.marcbelmont.com/2012/10/script-to-extract-email-attachments.html
# Usage:
# Run the script from a folder with file "all.mbox"
# Attachments will be extracted into subfolder "attachments"
# with prefix "n " where "n" is an order of attachment in mbox file.
# ---------------
@anthonymobile
anthonymobile / 2-macOS-10.13-high-sierra-setup-brewfile
Created October 7, 2018 02:28 — forked from kevinelliott/1-macOS-10.13-high-sierra-setup.md
macOS 10.13 High Sierra Mostly-Automated Setup
tap "caskroom/cask"
tap "caskroom/drivers"
tap "caskroom/fonts"
tap "heroku/brew"
tap "homebrew/bundle"
tap "homebrew/core"
tap "homebrew/fuse"
tap "homebrew/science"
tap "homebrew/services"
tap "luckyframework/lucky"
# List unique values in a DataFrame column
# h/t @makmanalp for the updated syntax!
df['Column Name'].unique()
# Convert Series datatype to numeric (will error if column has non-numeric values)
# h/t @makmanalp
pd.to_numeric(df['Column Name'])
# Convert Series datatype to numeric, changing non-numeric values to NaN
# h/t @makmanalp for the updated syntax!