Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 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()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement