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

Analyzing toy durability

In product development within the toy industry, it's crucial to understand the durability of toys, particularly when comparing educational toys to recreational ones. Durability can significantly impact customer satisfaction and repeat business. Researchers in a toy manufacturing company have asked you to conduct the analysis of a study comparing the durability of educational toys versus recreational toys. The toy_durability DataFrame contains the results of these tests, with durability scores assigned based on rigorous testing protocols.

The data is available in the toy_durability DataFrame. pandas as pd and from scipy.stats import ttest_ind have been loaded.

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

Experimental Design in Python

ดูคอร์ส

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

  • Calculate the mean 'Durability_Score' for both 'Educational' and 'Recreational' toys using a pivot table.
  • Perform an independent samples t-test to compare the durability of 'Educational' and 'Recreational' toys by first separating durability scores by Toy_Type.

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

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

# Calculate mean Durability_Score for each Toy_Type
mean_durability = toy_durability.pivot_table(
  values='____', index='____', aggfunc="mean")
print(mean_durability)

# Perform t-test
educational_durability = toy_durability[toy_durability['Toy_Type'] == '____']['Durability_Score']
recreational_durability = toy_durability[toy_durability['Toy_Type'] == '____']['Durability_Score']
t_stat, p_val = ttest_ind(____, ____)

print(p_val)
แก้ไขและรันโค้ด