Python statistics.harmonic_mean() နည်းလမ်း
ဥပမာ
ပေးထားသောဒေတာ၏ ဟာမိုနီပျမ်းမျှကို တွက်ချက်ပါ-
# Import statistics Library
import statistics
# Calculate
harmonic mean
print(statistics.harmonic_mean([40,
60, 80]))
print(statistics.harmonic_mean([10, 30, 50, 70, 90]))
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
statistics.harmonic_mean()
နည်းလမ်းသည် ပေးထားသောဒေတာအစုံ၏ ဟာမိုနီပျမ်းမျှ (ဗဟိုတည်နေရာ) ကို တွက်ချက်သည် ။
Harmonic mean = ဒေတာ အပြန်အလှန် ကိန်းဂဏန်း ဂဏန်းသင်္ချာ၏ အပြန်အလှန် ကိန်းဂဏန်း () ။
ဟာမိုနီ ပျမ်းမျှအား အောက်ပါအတိုင်း တွက်ချက်သည်။
သင့်တွင် တန်ဖိုးလေးခု (a၊ b၊ c နှင့် d) ရှိပါက - ၎င်းသည် 4 / (1/a + 1/b + 1/c + 1/d) နှင့် ညီမျှပါမည်။
အထားအသို
statistics.harmonic_mean(data)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
data | Required. The data values to be used (can be any sequence, list or iterator). Note: Cannot contain negative values! |
မှတ်ချက်- ဒေတာ ဗလာ ဖြစ်ပါက ၊ ၎င်းသည် StatisticsError ကို ပြန်ပေးသည်။
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | float ပေးထားသောဒေတာ၏ ဟာမိုနီဆိုလိုအား ကိုယ်စားပြု တန်ဖိုး |
---|---|
Python ဗားရှင်း- | ၃.၆ |