Z-Scores
The z-score of a number says how many standard deviations it is above the mean: (x - mean) / std, using the population standard deviation (np.std). Return an array with the z-score of every number.
Example 1
nums [1,3]
returns [-1.0,1.0]
The mean is 2 and the standard deviation is 1, so the z-scores are -1 and 1.
Constraints
2 <= len(nums) <= 100- The numbers are not all equal
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- Zero PositionsEasy
- Best Columns of Each RowMedium
- Cells Above Row AverageMedium
- Count Local PeaksMedium
- Deepest Fall From a HighMedium
- Distance From a CellMedium
- Halfway PointMedium
- Highest Cell PositionMedium