Skip to content

Instantly share code, notes, and snippets.

View ClintWeathers's full-sized avatar

Clint Weathers ClintWeathers

  • Target
  • Minneapolis, MN
View GitHub Profile
# 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!
# shortform git commands
alias g='git'
# Get a list of all TODO/FIXME tasks left to be done in your project
alias tasks='grep --exclude-dir=.git -rEI "TODO|FIXME" . 2>/dev/null'
# edit your gitignore from anywhere in your repo
vim $(git rev-parse --show-toplevel)/.gitignore
# simple single-lined git log