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 |
မှတ်ချက်- ဒေတာ ဗလာ ဖြစ်ပါက ၊ ၎င်းသည် StatisticsError ကို ပြန်ပေးသည်။
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | float ပေးထားသောဒေတာ၏ လူဦးရေကွဲလွဲမှုကို ကိုယ်စားပြုသော တန်ဖိုး တစ်ခု |
---|---|
Python ဗားရှင်း- | ၃.၄ |