Skip to content

Instantly share code, notes, and snippets.

@dvgodoy
Last active March 9, 2019 11:17
Show Gist options
  • Save dvgodoy/c849b9324b044e772498768ad84c38fb to your computer and use it in GitHub Desktop.
Save dvgodoy/c849b9324b044e772498768ad84c38fb to your computer and use it in GitHub Desktop.
### CLEANING UP DATA
### IMPUTING MISSING VALUES
# Fills missing values for Age, stratifying it by Pclass and Sex
hdf_filled = hdf.stratify(['Pclass', 'Sex']).fill(continuous=['Age'], strategy=['mean'])
### HANDLING OUTLIERS
# Fences outlier values for Fare
hdf_fenced = hdf_filled.fence(['Fare'], k=3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment