At Acme Analytics, you need a utility function that summarizes a list of numeric values. Write a function that returns the mean and population standard deviation of a list of numbers.
The mean is the sum of all values divided by the number of values. The population standard deviation is defined as sqrt(sum((x - mean)^2) / n).
nums of integers or floating-point numbers[mean, standard_deviation]If the input list is empty, return [0, 0].
Example 1
Input: nums = [2, 4, 4, 4, 5, 5, 7, 9]
Output: [5.0, 2.0]
Explanation: The mean is 5.0, and the population standard deviation is 2.0.
Example 2
Input: nums = [3]
Output: [3.0, 0.0]
Explanation: A single value has no spread, so the standard deviation is 0.0.
0 <= len(nums) <= 10^5-10^6 <= nums[i] <= 10^6