เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

สำรวจ Base Table

ก่อนเริ่มสร้างโมเดล ควรทำความเข้าใจข้อมูลที่จะใช้งานให้ดีเสียก่อน ในแบบฝึกหัดนี้ จะได้เรียนรู้วิธีดึงข้อมูลขนาดประชากร จำนวน target และ target incidence จาก basetable ที่กำหนดให้

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

การวิเคราะห์เชิงพยากรณ์เบื้องต้นด้วย Python

ดูคอร์ส

คำแนะนำการฝึกหัด

  • โหลด basetable ไว้ในออบเจกต์ pandas ชื่อ basetable แล้ว — กำหนดจำนวนแถวให้กับตัวแปร population_size และพิมพ์ค่าออกมา
  • กำหนดจำนวน target ที่มีค่าเท่ากับ 1 ให้กับตัวแปร targets_count และพิมพ์ค่าออกมา
  • พิมพ์ค่า target incidence ซึ่งคืออัตราส่วนของ targets_count ต่อ population_size

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Assign the number of rows in the basetable to the variable 'population_size'.
population_size  = ____(____)

# Print the population size.
print(____)

# Assign the number of targets to the variable 'targets_count'.
targets_count = ____(____[____])

# Print the number of targets.
print(____)

# Print the target incidence.
print(____ / ____)
แก้ไขและรันโค้ด