Category: လမ်းညွှန်
Python တွင် ဖြန့်ဖြူးမှုပုံကြမ်းကို ဖန်တီးရန် ဘုံနည်းလမ်းနှစ်ခုရှိသည်။ နည်းလမ်း 1- Matplotlib ကို အသုံးပြု၍ Histogram ဖန်တီးပါ။ import matplotlib. pyplot as plt plt. hist (data, color=' lightgreen ', ec=' black ', bins= 15 ) အရောင် သည် ဘားများ၏ ဖြည့်စွက်အရောင်ကို ထိန်းချုပ်သည်၊ ec သည် ဘားအစွန်းများ၏အရောင်ကို ထိန်းချုပ်သည်၊ bins သည် histogram...
R programming language တွင် ရေပန်းအစားဆုံး data visualization packages တစ်ခုမှာ ggplot2 ဖြစ်သည်။ Matplotlib တွင် ဖန်တီးထားသော ကွက်ကွက်တစ်ခုသို့ ggplot2 စတိုင်ကို အသုံးပြုရန်၊ အောက်ပါ syntax ကို သင်အသုံးပြုနိုင်သည်- import matplotlib. pyplot as plt plt. style . use (' ggplot ') အောက်ဖော်ပြပါ ဥပမာသည် ဤ syntax ကို လက်တွေ့တွင် မည်သို့အသုံးပြုရမည်ကို...
Matplotlib ရှိ ကွက်တစ်ခု၏ x နှင့် y axes အတွက် ဝင်ရိုးကန့်သတ်ချက်များကို ရယူရန် အောက်ပါ syntax ကို သင်အသုံးပြုနိုင်သည်- import matplotlib. pyplot as plt #get x-axis and y-axis limits xmin, xmax, ymin, ymax = plt. axis () #print axis limits print (xmin, xmax, ymin, ymax) အောက်ဖော်ပြပါ...
Matplotlib ရှိ သတ်မှတ်ထားသော ရက်စွဲတစ်ခုသို့ ဒေါင်လိုက်မျဉ်းတစ်ခုကို ထည့်ရန် datetime( ) လုပ်ဆောင်ချက်ဖြင့် axvline() လုပ်ဆောင်ချက်ကို သင်အသုံးပြုနိုင်သည်- import datetime import matplotlib. pyplot as plt plt. axvline ( datetime.datetime (2023, 1, 5)) ဤဥပမာသည် Matplotlib ရှိကွက်တစ်ခု၏ x-axis တွင် 05/01/2023 တွင် ဒေါင်လိုက်မျဉ်းကို ပေါင်းထည့်သည်။ အောက်ဖော်ပြပါ ဥပမာသည် ဤ syntax ကို လက်တွေ့တွင်...
Matplotlib ရှိ သီးခြားအပိုင်းခွဲများသို့ စာသားထည့်ရန် အောက်ပါ syntax ကို သင်အသုံးပြုနိုင်သည်- import matplotlib. pyplot as plt #define subplot layout fig, ax = plt. subplots (2, 1, figsize=(7,4)) #add text at specific locations in subplots ax[0]. text (1.5, 20, ' Here is some text in...
Seaborn ရှိ point cloud သို့ လိုင်းတစ်ခုထည့်ရန် အောက်ပါနည်းလမ်းများကို သင်အသုံးပြုနိုင်သည်- နည်းလမ်း 1- အလျားလိုက်မျဉ်းတစ်ခုထည့်ပါ။ #add horizontal line at y=15 plt. axhline (y=15) နည်းလမ်း 2- ဒေါင်လိုက်မျဉ်းတစ်ခုထည့်ပါ။ #add vertical line at x=4 plt. axvline (x=4) နည်းလမ်း 3- စိတ်ကြိုက်အတန်းတစ်ခုထည့်ပါ။ #add straight line that extends from (x,y) coordinates...
သင်သည် အခြားသော DataFrame အတွင်းတွင် ပန်ဒါ DataFrames များစွာကို အသိုက်ပြုလုပ်ရန် အောက်ပါ syntax ကို အသုံးပြုနိုင်ပါသည်။ df_all = pd. DataFrame ({' idx ':[1,2,3],' dfs ':[df1,df2,df3]}) ဤဥပမာသည် DataFrames သုံးခု ( df1 , df2 , df3 ) ကို df_all ဟုခေါ်သော ပိုကြီးသော DataFrame တစ်ခုအဖြစ် စုစည်းထားသည်။ ထို့နောက် သီးခြား nested...
စာရင်းဇယားများတွင်၊ quartiles များသည် ဒေတာအစုတစ်ခုကို အညီအမျှ လေးပိုင်းခွဲ၍ တန်ဖိုးများဖြစ်သည်။ ဖြန့်ဖြူးမှုကို ခွဲခြမ်းစိတ်ဖြာသောအခါ၊ ကျွန်ုပ်တို့သည် ယေဘူယျအားဖြင့် အောက်ပါ quartile များကို စိတ်ဝင်စားသည်- ပထမအကြိမ် ( Q1 ): 25th ရာခိုင်နှုန်းတွင်ရှိသောတန်ဖိုး ဒုတိယ quartile ( Q2 ): 50th ရာခိုင်နှုန်းတွင်ရှိသောတန်ဖိုး Third quartile ( Q3 ) : 75th percentile တွင်ရှိသော တန်ဖိုး Pandas DataFrame ရှိ...
အချိန်ကို ပန်ဒါများတွင် မှတ်မိနိုင်သော ရက်စွဲ/အချိန်အဖြစ်သို့ ပြောင်းလဲရန် အောက်ပါအခြေခံ syntax ကို သင်အသုံးပြုနိုင်သည်- df[' date_column '] = pd. to_datetime (df[' date_column '], unit=' s ') ဥပမာအားဖြင့်၊ ဤ syntax သည် 1655439422 ၏ epoch time ကို 2022-06-17 04:17:02 ၏ pandas datetime အဖြစ်သို့ ပြောင်းပေးပါမည်။ ဤဖော်မတ်သည် ဂဏန်းစာတန်းရှည်များထက် ရက်စွဲနှင့် အချိန်အဖြစ်...
သင်သည် Matplotlib တွင် Tight_layout() လုပ်ဆောင်ချက်ကို အသုံးပြု၍ အပိုင်းခွဲများကြားနှင့် အနီးတစ်ဝိုက်ကြားတွင် ကွက်လပ်များကို အလိုအလျောက်ချိန်ညှိနိုင်သည်။ အောက်ဖော်ပြပါ ဥပမာသည် ဤလုပ်ဆောင်ချက်ကို လက်တွေ့အသုံးချနည်းကို ပြသထားသည်။ ဥပမာ- Matplotlib တွင် Tight_layout() ကိုအသုံးပြုနည်း 2×2 ဇယားကွက်လေးခုဖန်တီးရန် Matplotilb ကိုအသုံးပြုသည်ဆိုပါစို့။ import matplotlib. pyplot as plt #define data x = [1, 2, 3] y = [7, 13, 24]...