Is this function working as I expect it to? Filtering the data to just the values within…
Rate quality
Private research annotation
Sign in to add a private research label or note.
Jump to turn (11)
- 1Is this function working as I expect it to? Filtering the data to just the value
- 2Well when I make the table, I dont see any NaN values
- 3Sorry, i meant with the where method. it doesnt create any NaNs in my table
- 4So is the best way to remove outliers in pandas with the mask method?
- 5So if im not seeing any nans in my where table, could that mean im calculating t
- 6Is there a way I can explicitly see NaN values? when I export it to CSV I just s
- 7Is there a way to see how many rows have nan values in them?
- 8So what is the axis parameter?
- 9Is there a normalize method in pandas?
- 10Why would the Z-score be producing negative values? Is that expected?
- 11Is there an easy way to remove the index column from the data
- User
Is this function working as I expect it to? Filtering the data to just the values within the given threshold series
Remove outliers
numerical_columns = ['age', 'bp', 'bgr', 'bu', 'sc', 'sod', 'pot', 'hemo', 'pcv', 'wbcc', 'rbcc'] avgs = ckd[numerical_columns].mean() # get averages stdev = ckd[numerical_columns].std() # get standard deviation threshold = 3 * stdev # get the outlier threshold
ckd_no_outliers = ckd[numerical_columns].where((ckd[numerical_columns] > (avgs - threshold)) & (ckd[numerical_columns] < (avgs + threshold)))
display(ckd_no_outliers)
- Assistant