Last active
September 20, 2017 01:20
-
-
Save FavioVazquez/94360cdb07ef01fdae595ccc8e634ca9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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