Pandas တွင် scatter matrix ဖန်တီးနည်း (ဥပမာများနှင့်အတူ)
scatterplot matrix သည် ၎င်းနှင့်တူသည် – scatterplot matrix။
ဤ matrix အမျိုးအစားသည် ဒေတာအစုံရှိ ကိန်းရှင်များစွာကြားရှိ ဆက်စပ်မှုကို တစ်ပြိုင်နက် မြင်ယောင်နိုင်စေသောကြောင့် အသုံးဝင်ပါသည်။
ပန်ဒါဒေတာဘောင်တစ်ခုမှ scatter matrix ကိုဖန်တီးရန် scatter_matrix() လုပ်ဆောင်ချက်ကို သင်အသုံးပြုနိုင်သည်-
p.d. plotting . scatter_matrix (df)
အောက်ဖော်ပြပါနမူနာများသည် အောက်ပါ pandas DataFrame နှင့် လက်တွေ့တွင် ဤ syntax ကိုမည်သို့အသုံးပြုရမည်ကို ပြသသည် ။
import pandas as pd import numpy as np #make this example reproducible n.p. random . seeds (0) #createDataFrame df = pd. DataFrame ({' points ': np.random.randn(1000), ' assists ': np.random.randn(1000), ' rebounds ': np.random.randn(1000)}) #view first five rows of DataFrame df. head () points assists rebounds 0 1.764052 0.555963 -1.532921 1 0.400157 0.892474 -1.711970 2 0.978738 -0.422315 0.046135 3 2.240893 0.104714 -0.958374 4 1.867558 0.228053 -0.080812
ဥပမာ 1- အခြေခံ diffusion matrix
အောက်ဖော်ပြပါ ကုဒ်သည် အခြေခံ dispersion matrix ကို ဖန်တီးနည်းကို ပြသသည် ။
p.d. plotting . scatter_matrix (df)
ဥပမာ 2- သီးခြားကော်လံများအတွက် Scatter matrix
အောက်ပါကုဒ်သည် DataFrame ၏ပထမကော်လံနှစ်ခုအတွက်သာ scatter matrix ကိုဖန်တီးနည်းကိုပြသသည်-
p.d. plotting . scatter_matrix (df. iloc [:, 0:2])
ဥပမာ 3- စိတ်ကြိုက်အရောင်များနှင့် ပုံးများဖြင့် ဖြန့်ခွဲပါ။
အောက်ပါကုဒ်သည် စိတ်ကြိုက်အရောင်များနှင့် ဟီစတိုဂရမ်များအတွက် အုပ်စုအရေအတွက်တစ်ခုနှင့် ဖြန့်ကျက်မက်ထရစ်ကို မည်သို့ဖန်တီးရမည်ကို ပြသသည်-
p.d. plotting . scatter_matrix (df, color=' red ', hist_kwds={' bins ': 30 , 'color': ' red '})
ဥပမာ 4- KDE ကြံစည်မှုဖြင့် ဖြန့်ကျက်မက်ထရစ်
အောက်ပါကုဒ်သည် histogram အစား matrix ထောင့်ဖြတ်တစ်လျှောက်ရှိ kernel density ခန့်မှန်းကွက်ဖြင့် ပြန့်ကျဲနေသော matrix တစ်ခုကို ဖန်တီးနည်းကို ပြသသည်-
p.d. plotting . scatter_matrix (df, diagonal=' kde ')
scatter_matrix() လုပ်ဆောင်ချက်၏ အွန်လိုင်းစာရွက်စာတမ်းအပြည့်အစုံကို ဤနေရာတွင် ရှာတွေ့နိုင်ပါသည်။
ထပ်လောင်းအရင်းအမြစ်များ
အောက်ပါသင်ခန်းစာများသည် Python တွင် အခြားဘုံဇယားများကို ဖန်တီးနည်းကို ရှင်းပြသည်-
Python တွင် Heat Maps ကိုဖန်တီးနည်း
Python တွင် Bell Curve ဖန်တီးနည်း
Python တွင် Ogive Chart ဖန်တီးနည်း