NumPy: สถิติเบื้องต้น

Python เบื้องต้น

Hugo Bowne-Anderson

Data Scientist at DataCamp

การวิเคราะห์ข้อมูล

  • ทำความรู้จักกับข้อมูล

  • ข้อมูลน้อย -> ดูตรง ๆ ได้เลย

  • ข้อมูลมาก -> ?

Python เบื้องต้น

การสำรวจทั่วเมือง

import numpy as np
np_city = ... # Implementation left out
np_city
array([[1.64, 71.78],
       [1.37, 63.35],
       [1.6 , 55.09],
       ...,
       [2.04, 74.85],
       [2.04, 68.72],
       [2.01, 73.57]])
Python เบื้องต้น

NumPy

np.mean(np_city[:, 0])
1.7472
np.median(np_city[:, 0])
1.75
Python เบื้องต้น

NumPy

np.corrcoef(np_city[:, 0], np_city[:, 1])
array([[ 1.     , -0.01802],
       [-0.01803,  1.     ]])
np.std(np_city[:, 0])
0.1992
  • sum(), sort(), ...

  • กำหนดชนิดข้อมูลเดียว: ความเร็ว!

Python เบื้องต้น

สร้างข้อมูล

  • อาร์กิวเมนต์ของ np.random.normal()
    • ค่าเฉลี่ยของการแจกแจง
    • ส่วนเบี่ยงเบนมาตรฐานของการแจกแจง
    • จำนวนตัวอย่าง
height = np.round(np.random.normal(1.75, 0.20, 5000), 2)

weight = np.round(np.random.normal(60.32, 15, 5000), 2)


np_city = np.column_stack((height, weight))
Python เบื้องต้น

มาฝึกกันเถอะ!

Python เบื้องต้น

Preparing Video For Download...