Outlier Count
A value is an outlier if it is more than k standard deviations away from the mean, that is |x - mean| > k * std, using the population standard deviation (np.std). Return how many outliers nums has.
Example 1
nums [10,10,10,10,10,10,10,10,10,100]
k 2
returns 1
Only the 100 is far from the mean.
Constraints
1 <= len(nums) <= 100- No value is exactly
kstandard deviations from the mean
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- Pair DifferencesEasy
- Percent ChangeEasy
- Row RangesEasy
- Rows With a ZeroEasy
- Rows of WidthEasy
- Runner-Up per RowEasy
- Running Total per ColumnEasy
- Scale to Zero OneEasy