Python statistics.mode() နည်းလမ်း
ဥပမာ
ပေးထားသောဒေတာ၏မုဒ် (ဗဟိုသဘောထား) ကိုတွက်ချက်ပါ-
# Import statistics Library
import statistics
# Calculate
the mode
print(statistics.mode([1, 3,
3, 3, 5, 7, 7 9, 11]))
print(statistics.mode([1, 1, 3, -5, 7, -9, 11]))
print(statistics.mode(['red',
'green', 'blue', 'red']))
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
statistics.mode()
နည်းလမ်းသည် ပေးထားသော ဂဏန်း သို့မဟုတ် အမည်ခံဒေတာအစုံ၏ မုဒ် (ဗဟိုသဘောထား) ကို တွက်ချက်သည် ။
အထားအသို
statistics.mode(data)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
data | Required. The data values to be used (can be any sequence, list or iterator) |
မှတ်ချက်- ဒေတာ ဗလာ ဖြစ်ပါက ၊ ၎င်းသည် StatisticsError ကို ပြန်ပေးသည်။
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | float ပေးထားသောဒေတာ၏မုဒ်ကိုကိုယ်စားပြုသော သို့မဟုတ် အမည်ခံ တန်ဖိုး |
---|---|
Python ဗားရှင်း- | ၃.၄ |
မှတ်တမ်းပြောင်းရန်- | 3.8- ယခု ဘက်စုံသုံးဒေတာအတွဲများကို ကိုင်တွယ်သည် (ပထမဆုံးကြုံတွေ့ရသည့်မုဒ်ကို ပြန်ပေးမည်) |