สมัครเรียนโทร. 085-350-7540 , 084-88-00-255 , ntprintf@gmail.com


Seaborn

เรียนเขียนโปรแกรมง่ายๆกับ Expert Programming Tutor ในบท Seaborn
แสดงภาพการแจกแจงด้วย Seaborn
 Seaborn เป็นไลบรารีที่ใช้ Matplotlib ด้านล่างเพื่อพล็อตกราฟ มันจะถูกใช้เพื่อให้เห็นภาพการแจกแจงแบบสุ่ม
ติดตั้ง Seaborn
หากนักเรียนมี Python และ PIP ติดตั้งอยู่แล้วในระบบให้ติดตั้งโดยใช้คำสั่งนี้

C:\Users\Your Name>pip install seaborn

หากนักเรียนใช้ Jupyter ให้ติดตั้ง Seaborn โดยใช้คำสั่งนี้

C:\Users\Your Name>!pip install seaborn

Distplots
 Distplot ย่อมาจากพล็อตการกระจาย ซึ่งมันจะใช้เป็นอินพุตอาร์เรย์และพล็อตโค้งที่สอดคล้องกับการกระจายของคะแนนในอาร์เรย์
import Matplotlib
 import วัตถุ pyplot ของโมดูล Matplotlib ในโค้ดของนักเรียนเองโดยจะใช้โค้ดต่อไปนี้

import seaborn as sns

import Seaborn
import Seaborn ในโค้ดของนักเรียนเองโดยจะใช้โค้ดต่อไปนี้

import matplotlib.pyplot as plt

พล็อต Displot
ตัวอย่าง

import matplotlib.pyplot as plt
import seaborn as sns

sns.distplot([0, 1, 2, 3, 4, 5])

plt.show()

ผลลัพธ์


หมายเหตุ: เราจะใช้: sns.distplot (arr, hist = False) เพื่อให้เห็นภาพการแจกแจงแบบสุ่มในบทนี้
เป็นอย่างไรบ้าง การติดตั้งโปรแกรมมีปัญหาหรือเปล่า แก้ไขปัญหากันอย่างไรครับ ถ้าใครติดตั้งเสร็จเเล้วก็ไปสู่บทความถัดไปได้เลยครับผม 
 
 
แปลจากhttps://www.w3schools.com/python/numpy_random_seaborn.asp


Tag ที่น่าสนใจ: java c# vb.net python c c++ machine_learning web database oop cloud aws ios android


บทความนี้อาจจะมีที่ผิด กรุณาตรวจสอบก่อนใช้

หากมีข้อผิดพลาด/ต้องการพูดคุยเพิ่มเติมเกี่ยวกับบทความนี้ กรุณาแจ้งที่ http://m.me/Expert.Programming.Tutor

ไม่อยากอ่าน Tutorial อยากมาเรียนเลยทำอย่างไร?

สมัครเรียน ONLINE ได้ทันทีที่ https://elearn.expert-programming-tutor.com

หรือติดต่อ

085-350-7540 (DTAC)
084-88-00-255 (AIS)
026-111-618
หรือทาง EMAIL: NTPRINTF@GMAIL.COM

แผนที่ ที่ตั้งของอาคารของเรา

แผนผังการเรียนเขียนโปรแกรม

Link อื่นๆ

Allow sites to save and read cookie data.
Cookies are small pieces of data created by sites you visit. They make your online experience easier by saving browsing information. We use cookies to improve your experience on our website. By browsing this website, you agree to our use of cookies.

Copyright (c) 2013 expert-programming-tutor.com. All rights reserved. | 085-350-7540 | 084-88-00-255 | ntprintf@gmail.com

ติดต่อเราได้ที่

085-350-7540 (DTAC)
084-88-00-255 (AIS)
026-111-618
หรือทาง EMAIL: NTPRINTF@GMAIL.COM
แผนที่ ที่ตั้งของอาคารของเรา