Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. # Import optimus
  2. import optimus as op
  3. # Choose a column for analyzing
  4. detector = op.OutlierDetector(df,"num")
  5. # With the outliers() method you can use MAD to detect if there is an outlier in your column
  6. detector.outliers()
  7. # And with the run() method you can see which values are not outliers
  8. detector.run()
  9. # Finally with the delete_outliers() method you can delete existing outliers in your column.
  10. # This will modify the dataframe we have used when instantiating the OutlierDetector
  11. # (deleting the whole row that contains the outlier value), but the original dataframe that we
  12. # read from disk will be intact.
  13. detector.delete_outliers().show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement