Skip to content

Instantly share code, notes, and snippets.

@FavioVazquez
Last active September 20, 2017 01:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FavioVazquez/94360cdb07ef01fdae595ccc8e634ca9 to your computer and use it in GitHub Desktop.
Save FavioVazquez/94360cdb07ef01fdae595ccc8e634ca9 to your computer and use it in GitHub Desktop.
# Import optimus
import optimus as op
# Choose a column for analyzing
detector = op.OutlierDetector(df,"num")
# With the outliers() method you can use MAD to detect if there is an outlier in your column
detector.outliers()
# And with the run() method you can see which values are not outliers
detector.run()
# Finally with the delete_outliers() method you can delete existing outliers in your column.
# This will modify the dataframe we have used when instantiating the OutlierDetector
# (deleting the whole row that contains the outlier value), but the original dataframe that we
# read from disk will be intact.
detector.delete_outliers().show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment