Examining traffic violations
Before comparing the violations being committed by each gender, you should examine the violations committed by all drivers to get a baseline understanding of the data.
In this exercise, you'll count the unique values in the violation column, and then separately express those counts as proportions.
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Analyzing Police Activity with pandas
คำแนะนำการฝึกหัด
- Count the unique values in the
violationcolumn of theriDataFrame, to see what violations are being committed by all drivers. - Express the violation counts as proportions of the total.
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Count the unique values in 'violation'
print(____)
# Express the counts as proportions
print(____)