Created
April 3, 2021 15:29
-
-
Save HeenaR17/94cd246bc63ab0d8bc7115ac213f3425 to your computer and use it in GitHub Desktop.
This file contains 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
##checking outliers | |
outliers=[] | |
def detect_outliers(data): | |
threshold=3 #3rd std deviation | |
mean=np.mean(data) | |
std=np.std(data) | |
for i in data: | |
z_score=(i-mean)/std | |
if np.abs(z_score)>threshold: | |
outliers.append(i) | |
return outliers | |
outlier=detect_outliers(df['Age']) | |
outlier |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment