The Python statistics.pstdev() function calculates the standard deviation for the entire population. A large standard deviation means that the data is widely spread out, while a small standard deviation means that the data is close to the mean. This function measures how spread out the numbers are.
A measure of mean data is dispersed in relation to the standard deviation. Unlike the variance, the standard deviation contains the same units as the data. The square root of the sample variance is the standard deviation.
SyntaxFollowing is the basic syntax for the statistics.pstdev() function.
statistics.pstdev(data, xbar)Parameters
Here, the data values can be used as any sequence, list or x-bar in statistics, which is a symbol for the sample mean.
Return ValueThis function returns the float value, i.e., representing the population standard deviation of the given data.
Example 1In the below example, we are calculating the standard deviation of an entire population using the statistics.pstdev() function.
import statistics x = statistics.pstdev([2, 4, 6, 8, 10]) print(x)Output
The result is produced as follows −
2.8284271247461903Example 2
Now, we are calculating the float values using the statistics.pstdev() function.
import statistics x = statistics.pstdev([0.3, 5.5, 7.6, 0.34, 2.3]) print(x)Output
We will get the output as shown below −
2.899975172307515Example 3
Here, we are calculating the standard deviation using the statistics.pstdev() function.
import statistics x = statistics.pstdev([1, 5, 6.10, 400, -0.4, -34]) print(x)Output
When we execute the above code, we will get the following output −
151.3512223274064
python_modules.htm
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4