Python ကျူတိုရီရယ်

Python ပင်မစာမျက်နှာ Python နိဒါန်း Python ကို စတင်လိုက်ပါ။ Python Syntax Python မှတ်ချက်များ Python Variables များ Python Data အမျိုးအစားများ Python နံပါတ်များ Python Casting Python ကြိုးများ Python Booleans Python အော်ပရေတာများ Python စာရင်းများ Python Tuples Python အစုံများ Python အဘိဓာန်များ Python If... Else Python while Loops Python For Loops Python လုပ်ဆောင်ချက်များ Python Lambda Python Arrays Python အတန်းများ/အရာဝတ္ထုများ Python Inheritance Python Iterators Python နယ်ပယ် Python Modules Python နေ့စွဲများ Python သင်္ချာ Python JSON Python RegEx Python PIP Python ကိုစမ်းကြည့်ပါ... ကလွဲရင် Python အသုံးပြုသူ ထည့်သွင်းမှု Python String Formatting

ဖိုင်ကိုင်တွယ်ခြင်း။

Python ဖိုင်ကို ကိုင်တွယ်ခြင်း။ Python ဖိုင်များကိုဖတ်ပါ။ Python ဖိုင်များကို ရေးသားခြင်း/ဖန်တီးပါ။ Python ဖိုင်များကိုဖျက်ပါ။

Python Modules

NumPy ကျူတိုရီရယ် Panda ကျင့်စဉ် Scipy ကျူတိုရီရယ်

Python Matplotlib

Matplotlib နိဒါန်း Matplotlib ကို စတင်လိုက်ပါ။ Matplotlib Pyplot Matplotlib Plotting Matplotlib အမှတ်အသားများ Matplotlib လိုင်း Matplotlib အညွှန်းများ Matplotlib Grid Matplotlib အပိုင်းခွဲများ Matplotlib ဖြန့်ကြဲခြင်း။ Matplotlib ဘားများ Matplotlib Histograms Matplotlib Pie ဇယားများ

စက်သင်ယူခြင်း။

စတင်အသုံးပြုခြင်း Mean Median Mode စံလွဲခြင်း။ ရာခိုင်နှုန်း ဒေတာဖြန့်ဝေခြင်း။ ပုံမှန်ဒေတာဖြန့်ဝေ ကွက်ကျားကွက်၊ Linear Regression Polynomial Regression Multiple Regression အတိုင်းအတာ ရထား/စမ်းသပ်မှု ဆုံးဖြတ်ချက်သစ်ပင်

Python MySQL

MySQL စတင်လိုက်ပါ။ MySQL ဒေတာဘေ့စ်ဖန်တီးပါ။ MySQL ဇယားဖန်တီးပါ။ MySQL ထည့်သွင်းခြင်း။ MySQL ကို ရွေးပါ။ MySQL ဘယ်မှာလဲ။ MySQL Order By MySQL ကိုဖျက်ပါ။ MySQL Drop Table MySQL အပ်ဒိတ် MySQL ကန့်သတ်ချက် MySQL Join

Python MongoDB

MongoDB စတင်လိုက်ပါ။ MongoDB ဒေတာဘေ့စ်ဖန်တီးပါ။ MongoDB သည် Collection ကိုဖန်တီးပါ။ MongoDB ထည့်သွင်းပါ။ MongoDB ကိုရှာပါ။ MongoDB မေးခွန်း MongoDB အမျိုးအစား MongoDB ကိုဖျက်ပါ။ MongoDB Drop Collection MongoDB အပ်ဒိတ် MongoDB ကန့်သတ်ချက်

Python အကိုးအကား

Python ခြုံငုံသုံးသပ်ချက် Python Built-in လုပ်ဆောင်ချက်များ Python String နည်းလမ်းများ Python စာရင်းနည်းလမ်းများ Python Dictionary Methods Python Tuple နည်းလမ်းများ Python သတ်မှတ်နည်းလမ်းများ Python ဖိုင်နည်းလမ်းများ Python သော့ချက်စာလုံးများ Python ခြွင်းချက်များ Python ဝေါဟာရ

Module အကိုးအကား

ကျပန်း Module တောင်းဆိုမှုများ Module Statistics Module သင်္ချာ မော်ဂျူး cMath မော်ဂျူး

Python လုပ်နည်း

စာရင်းပွားများကို ဖယ်ရှားပါ။ ကြိုးတစ်ချောင်းကို ပြောင်းပြန် နံပါတ်နှစ်ခုထည့်ပါ။

Python ဥပမာများ

Python ဥပမာများ Python Compiler Python လေ့ကျင့်ခန်းများ Python Quiz Python လက်မှတ်

Matplotlib ဖြန့်ကြဲခြင်း


Scatter Plots ဖန်တီးခြင်း။

Pyplot ဖြင့်၊ သင်သည် scatter()ဖြန့်ကြဲကွက်တစ်ခုဆွဲရန် လုပ်ဆောင်ချက်ကို အသုံးပြုနိုင်သည်။

လုပ်ဆောင်ချက် သည် scatter()စောင့်ကြည့်မှုတစ်ခုစီအတွက် အစက်တစ်စက်ကို ချပေးသည်။ ၎င်းသည် တူညီသောအလျားနှစ်ခု၊ x-ဝင်ရိုးတန်ဖိုးများအတွက် တစ်ခုနှင့် y-ဝင်ရိုးရှိတန်ဖိုးများအတွက် တစ်ခု လိုအပ်သည်-

ဥပမာ

ရိုးရှင်းသော ဖြန့်ကျက်ကြံစည်မှု

import matplotlib.pyplot as plt
import numpy as np

x = np.array([5,7,8,7,2,17,2,9,4,11,12,9,6])
y = np.array([99,86,87,88,111,86,103,87,94,78,77,85,86])

plt.scatter(x, y)
plt.show()

ရလဒ်:

အထက်ဖော်ပြပါ ဥပမာတွင် ဖြတ်သွားသော ကား ၁၃ စီး၏ ရလဒ်ဖြစ်သည်။

X-axis သည် ကား၏သက်တမ်းမည်မျှရှိသည်ကို ပြသသည်။

Y-axis သည် ကားဖြတ်သန်းသွားသောအခါတွင် အရှိန်ကိုပြသည်။

လေ့လာမှုတွေကြား ဆက်စပ်မှုရှိပါသလား။

ကားအသစ်လေလေ၊ ပိုမြန်လေလေလို့ထင်ရပေမယ့် အဲဒါက တိုက်ဆိုင်မှုတစ်ခုပဲ၊ ကျွန်တော်တို့အားလုံး မှတ်ပုံတင်ထားတဲ့ကား ၁၃ စီးပဲရှိတယ်။


Plots များကို နှိုင်းယှဉ်ပါ။

အထက်ဖော်ပြပါ ဥပမာတွင်၊ အမြန်နှုန်းနှင့် အသက်အကြား ဆက်စပ်မှုရှိပုံရသည်၊ သို့သော် ကျွန်ုပ်တို့သည် အခြားနေ့မှ အကဲခတ်ချက်များကို ပုံဖော်ထားလျှင်ကော။ ကွဲလွဲနေသော ဇာတ်ကွက်သည် ကျွန်ုပ်တို့အား အခြားအရာများကို ပြောပြမည်လား။

ဥပမာ

တူညီသောပုံပေါ်တွင် ကွက်နှစ်ကွက်ဆွဲပါ။

import matplotlib.pyplot as plt
import numpy as np

#day one, the age and speed of 13 cars:
x = np.array([5,7,8,7,2,17,2,9,4,11,12,9,6])
y = np.array([99,86,87,88,111,86,103,87,94,78,77,85,86])
plt.scatter(x, y)

#day two, the age and speed of 15 cars:
x = np.array([2,2,8,1,15,8,12,9,7,3,11,4,7,14,12])
y = np.array([100,105,84,105,90,99,90,95,94,100,79,112,91,80,85])
plt.scatter(x, y)

plt.show()

ရလဒ်:

မှတ်ချက်- ကွက်နှစ်ကွက်အား မတူညီသောအရောင်နှစ်မျိုးဖြင့် ပုံဖော်ထားပါသည်၊ မူရင်းအပြာနှင့် လိမ္မော်ရောင်ဖြင့် အရောင်ပြောင်းနည်းကို ဤအခန်းတွင် နောက်ပိုင်းတွင် သင်လေ့လာနိုင်မည်ဖြစ်ပါသည်။

မြေကွက်နှစ်ခုကို နှိုင်းယှဉ်ကြည့်ခြင်းဖြင့် ၎င်းတို့နှစ်ဦးစလုံးက ကျွန်ုပ်တို့ကို တူညီသော ကောက်ချက်ချသည်ဟု ဆိုနိုင်သည်- ကားအသစ်လေလေ၊ ပိုမြန်လေလေ မောင်းနှင်လေလေဟု စိတ်ချယုံကြည်မိပါသည်။



အရောင်များ

ကွက်လပ်တစ်ခုစီအတွက် colorသို့မဟုတ် c အကြောင်းပြချက်ဖြင့် သင့်ကိုယ်ပိုင်အရောင်ကို သင်သတ်မှတ်နိုင်သည်-

ဥပမာ

အမှတ်အသားများ၏ သင့်ကိုယ်ပိုင်အရောင်ကို သတ်မှတ်ပါ။

import matplotlib.pyplot as plt
import numpy as np

x = np.array([5,7,8,7,2,17,2,9,4,11,12,9,6])
y = np.array([99,86,87,88,111,86,103,87,94,78,77,85,86])
plt.scatter(x, y, color = 'hotpink')

x = np.array([2,2,8,1,15,8,12,9,7,3,11,4,7,14,12])
y = np.array([100,105,84,105,90,99,90,95,94,100,79,112,91,80,85])
plt.scatter(x, y, color = '#88c999')

plt.show()

ရလဒ်:


အစက်တစ်ခုစီကို အရောင်ခြယ်ပါ။

အစက်တစ်ခုစီအတွက် သတ်သတ်မှတ်မှတ်အရောင်တစ်ခုကိုပင် အကြောင်းပြချက်အတွက် တန်ဖိုးအဖြစ် အရောင်များ၏ array ကိုအသုံးပြုခြင်းဖြင့်ပင် သင်သတ်မှတ်နိုင်သည် c-

မှတ်ချက်- ဤအငြင်းအခုံကို သင် အသုံးပြု၍ မရပါ ၊ အကြောင်းပြချက်တစ်ခုတည်းသာ ဖြစ်သည်။colorc

ဥပမာ

အမှတ်အသားများ၏ သင့်ကိုယ်ပိုင်အရောင်ကို သတ်မှတ်ပါ။

import matplotlib.pyplot as plt
import numpy as np

x = np.array([5,7,8,7,2,17,2,9,4,11,12,9,6])
y = np.array([99,86,87,88,111,86,103,87,94,78,77,85,86])
colors = np.array(["red","green","blue","yellow","pink","black","orange","purple","beige","brown","gray","cyan","magenta"])

plt.scatter(x, y, c=colors)

plt.show()

ရလဒ်:


အရောင်မြေပုံ

Matplotlib module တွင် ရရှိနိုင်သော အရောင်ပြမြေပုံများစွာ ရှိသည်။

အရောင်ပြမြေပုံသည် အရောင်များစာရင်းတစ်ခုနှင့်တူသည်၊ အရောင်တစ်ခုစီတွင် 0 မှ 100 အထိတန်ဖိုးတစ်ခုရှိသည်။

ဤသည်မှာ အရောင်ပြမြေပုံ၏ ဥပမာတစ်ခုဖြစ်သည်။

ဤအရောင်ပြမြေပုံကို 'viridis' ဟုခေါ်ပြီး ၎င်းကို ခရမ်းရောင်အရောင်ဖြစ်သည့် 0 မှ 100 အထိ၊ အဝါရောင်ဖြစ်သည့် 100 အထိ ကွဲပြားသည်။

ColorMap ကိုအသုံးပြုနည်း

cmapဤအခြေအနေတွင် 'viridis'Matplotlib တွင်ရရှိနိုင်သည့် built-in colormaps များထဲမှတစ်ခုဖြစ်သည့် colormap ၏အဓိကစကားလုံးအငြင်းအခုံဖြင့် colormap ကိုသတ်မှတ်နိုင်သည် ။

ထို့အပြင် သင်သည် တန်ဖိုးများ (0 မှ 100) ရှိသော array တစ်ခုကို ဖန်တီးရန် လိုအပ်သည်-

ဥပမာ

ရောင်စုံခင်းကျင်းတစ်ခုကို ဖန်တီးပြီး ဖြန့်ကြဲချကွက်တွင် အရောင်မြေပုံတစ်ခုကို သတ်မှတ်ပါ-

import matplotlib.pyplot as plt
import numpy as np

x = np.array([5,7,8,7,2,17,2,9,4,11,12,9,6])
y = np.array([99,86,87,88,111,86,103,87,94,78,77,85,86])
colors = np.array([0, 10, 20, 30, 40, 45, 50, 55, 60, 70, 80, 90, 100])

plt.scatter(x, y, c=colors, cmap='viridis')

plt.show()

ရလဒ်:

ကြေညာချက် ကို ထည့်သွင်းခြင်းဖြင့် ပုံတွင် ရောင်စုံမြေပုံကို သင်ထည့်သွင်းနိုင်သည် plt.colorbar()-

ဥပမာ

အမှန်တကယ် အရောင်ပြမြေပုံကို ထည့်သွင်းပါ-

import matplotlib.pyplot as plt
import numpy as np

x = np.array([5,7,8,7,2,17,2,9,4,11,12,9,6])
y = np.array([99,86,87,88,111,86,103,87,94,78,77,85,86])
colors = np.array([0, 10, 20, 30, 40, 45, 50, 55, 60, 70, 80, 90, 100])

plt.scatter(x, y, c=colors, cmap='viridis')

plt.colorbar()

plt.show()

ရလဒ်:

ရနိုင်သော ColorMaps

Built-in ရောင်စုံမြေပုံများကို သင်ရွေးချယ်နိုင်သည်-

Name   Reverse
Accent   Accent_r
Blues   Blues_r
BrBG   BrBG_r
BuGn   BuGn_r
BuPu   BuPu_r
CMRmap   CMRmap_r
Dark2   Dark2_r
GnBu   GnBu_r
Greens   Greens_r
Greys   Greys_r
OrRd   OrRd_r
Oranges   Oranges_r
PRGn   PRGn_r
Paired   Paired_r
Pastel1   Pastel1_r
Pastel2   Pastel2_r
PiYG   PiYG_r
PuBu   PuBu_r
PuBuGn   PuBuGn_r
PuOr   PuOr_r
PuRd   PuRd_r
Purples   Purples_r
RdBu   RdBu_r
RdGy   RdGy_r
RdPu   RdPu_r
RdYlBu   RdYlBu_r
RdYlGn   RdYlGn_r
Reds   Reds_r
Set1   Set1_r
Set2   Set2_r
Set3   Set3_r
Spectral   Spectral_r
Wistia   Wistia_r
YlGn   YlGn_r
YlGnBu   YlGnBu_r
YlOrBr   YlOrBr_r
YlOrRd   YlOrRd_r
afmhot   afmhot_r
autumn   autumn_r
binary   binary_r
bone   bone_r
brg   brg_r
bwr   bwr_r
cividis   cividis_r
cool   cool_r
coolwarm   coolwarm_r
copper   copper_r
cubehelix   cubehelix_r
flag   flag_r
gist_earth   gist_earth_r
gist_gray   gist_gray_r
gist_heat   gist_heat_r
gist_ncar   gist_ncar_r
gist_rainbow   gist_rainbow_r
gist_stern   gist_stern_r
gist_yarg   gist_yarg_r
gnuplot   gnuplot_r
gnuplot2   gnuplot2_r
gray   gray_r
hot   hot_r
hsv   hsv_r
inferno   inferno_r
jet   jet_r
magma   magma_r
nipy_spectral   nipy_spectral_r
ocean   ocean_r
pink   pink_r
plasma   plasma_r
prism   prism_r
rainbow   rainbow_r
seismic   seismic_r
spring   spring_r
summer   summer_r
tab10   tab10_r
tab20   tab20_r
tab20b   tab20b_r
tab20c   tab20c_r
terrain   terrain_r
twilight   twilight_r
twilight_shifted   twilight_shifted_r
viridis   viridis_r
winter   winter_r

အရွယ်အစား

အကြောင်းပြချက်ဖြင့် အစက်များ၏ အရွယ်အစားကို သင်ပြောင်းလဲနိုင်သည် s

အရောင်များကဲ့သို့ပင်၊ အရွယ်အစားများအတွက် array သည် x- နှင့် y-axis အတွက် arrays များနှင့် တူညီကြောင်း သေချာပါစေ။

ဥပမာ

အမှတ်အသားများအတွက် သင့်ကိုယ်ပိုင်အရွယ်အစားကို သတ်မှတ်ပါ-

import matplotlib.pyplot as plt
import numpy as np

x = np.array([5,7,8,7,2,17,2,9,4,11,12,9,6])
y = np.array([99,86,87,88,111,86,103,87,94,78,77,85,86])
sizes = np.array([20,50,100,200,500,1000,60,90,10,300,600,800,75])

plt.scatter(x, y, s=sizes)

plt.show()

ရလဒ်:


အယ်လ်ဖာ

alphaအစက်များ၏ ပွင့်လင်းမြင်သာမှုကို အငြင်းအခုံ ဖြင့် ချိန်ညှိနိုင်သည် ။

အရောင်များကဲ့သို့ပင်၊ အရွယ်အစားများအတွက် array သည် x- နှင့် y-axis အတွက် arrays များနှင့် တူညီကြောင်း သေချာပါစေ။

ဥပမာ

အမှတ်အသားများအတွက် သင့်ကိုယ်ပိုင်အရွယ်အစားကို သတ်မှတ်ပါ-

import matplotlib.pyplot as plt
import numpy as np

x = np.array([5,7,8,7,2,17,2,9,4,11,12,9,6])
y = np.array([99,86,87,88,111,86,103,87,94,78,77,85,86])
sizes = np.array([20,50,100,200,500,1000,60,90,10,300,600,800,75])

plt.scatter(x, y, s=sizes, alpha=0.5)

plt.show()

ရလဒ်:


အရောင်အရွယ်အစားနှင့် Alpha ပေါင်းစပ်ပါ။

အစက်များပေါ်ရှိ အရွယ်အစားအမျိုးမျိုးဖြင့် အရောင်မြေပုံတစ်ခုကို ပေါင်းစပ်နိုင်သည်။ အစက်များ ဖောက်ထွင်းမြင်နိုင်လျှင် ၎င်းကို အကောင်းဆုံးမြင်နိုင်သည်-

ဥပမာ

x-points၊ y-points၊ အရောင်များနှင့် အရွယ်အစားများအတွက် တန်ဖိုး 100 ဖြင့် ကျပန်းအခင်းအကျင်းများကို ဖန်တီးပါ-

import matplotlib.pyplot as plt
import numpy as np

x = np.random.randint(100, size=(100))
y = np.random.randint(100, size=(100))
colors = np.random.randint(100, size=(100))
sizes = 10 * np.random.randint(100, size=(100))

plt.scatter(x, y, c=colors, s=sizes, alpha=0.5, cmap='nipy_spectral')

plt.colorbar()

plt.show()

ရလဒ်: