การสร้างฮิสโตแกรม

Python เบื้องต้นสำหรับ Data Science

Hillary Green-Lerman

Lead Data Scientist, Looker

ตามหาตัวผู้ลักพาตัว

Python เบื้องต้นสำหรับ Data Science

ฮิสโตแกรมคืออะไร?

Python เบื้องต้นสำหรับ Data Science

ฮิสโตแกรมด้วย matplotlib

plt.hist(gravel.mass)

plt.show()

Python เบื้องต้นสำหรับ Data Science

การปรับจำนวน bin

plt.hist(data, bins=nbins)
plt.hist(gravel.mass, bins=40)

Python เบื้องต้นสำหรับ Data Science

การปรับช่วงข้อมูล

plt.hist(data,
         range=(xmin, xmax))
plt.hist(gravel.mass,
         range=(50, 100))

Python เบื้องต้นสำหรับ Data Science

การนอร์มัลไลซ์

แผนภูมิแท่งที่ยังไม่ได้นอร์มัลไลซ์

plt.hist(male_weight)
plt.hist(female_weight)

ผลรวมของพื้นที่แท่ง = 1

plt.hist(male_weight, density=True)
plt.hist(female_weight, density=True)

Python เบื้องต้นสำหรับ Data Science

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

Python เบื้องต้นสำหรับ Data Science

Preparing Video For Download...