Created
October 30, 2023 17:56
-
-
Save rawlik/cf5c1c7ce2af9e64e5dcdf46f4fb0e62 to your computer and use it in GitHub Desktop.
Remove outliers
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
def remove_outliers(a, n): | |
asorted = a[np.argsort(np.abs(a - np.median(a)))] | |
return asorted[: -n] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment