طريقة Python Statistics.pvariance ()
مثال
احسب التباين لمحتوى بأكمله:
# Import statistics Library
import statistics
# Calculate
the variance of an entire population
print(statistics.pvariance([1, 3, 5, 7, 9, 11]))
print(statistics.pvariance([2,
2.5, 1.25, 3.1, 1.75, 2.8]))
print(statistics.pvariance([-11, 5.5, -3.4,
7.1]))
print(statistics.pvariance([1, 30, 50, 100]))
التعريف والاستخدام
تحسب الطريقة statistics.pvariance()
التباين لمحتوى بأكمله.
يشير التباين الكبير إلى أن البيانات منتشرة ، - يشير التباين الصغير إلى أن البيانات متجمعة بشكل وثيق حول الوسط.
نصيحة: لحساب التباين من عينة من البيانات ، انظر إلى statistics.variance()
الطريقة.
بناء الجملة
statistics.pvariance(data, xbar)
قيمه المعامل
Parameter | Description |
---|---|
data | Required. The data values to be used (can be any sequence, list or iterator) |
xbar | Optional. The mean of the given data (can also be a second moment around a point that is not the mean). If omitted (or set to None), the mean is automatically calculated |
ملاحظة: إذا كانت البيانات فارغة ، فإنها تُرجع خطأ في الإحصاء.
تفاصيل تقنية
قيمة الإرجاع: | قيمة float تمثل تباين المحتوى للبيانات المحددة |
---|---|
نسخة بايثون: | 3.4 |