Experimental Design in Python
James Chapman
Curriculum Manager, DataCamp
manufacturing_yield
BatchID MaterialType ProductionSpeed TemperatureSetting YieldStrength
39 Polymer Medium Optimal 58.83
195 Metal High High 51.29
462 Polymer High Optimal 55.15
696 Composite Medium Low 50.27
142 Composite High Low 57.62
MaterialType
, ProductionSpeed
, TemperatureSetting
YieldStrength
manufacturing_quality
BatchID ProductionSpeed ProductQuality
149 Low 93.87
739 High 93.35
617 Medium 90.45
131 High 90.26
684 Low 91.62
ProductionSpeed
ProductQuality
merged_manufacturing = pd.merge(manufacturing_yield,
manufacturing_quality,
on=['BatchID', 'ProductionSpeed'])
print(merged_manufacturing)
BatchID MaterialType ProductionSpeed TemperatureSetting YieldStrength ProductQuality
1 Metal Low High 57.32 91.19
5 Composite Medium Optimal 51.82 90.20
7 Polymer Low High 56.12 91.66
8 Composite High Optimal 50.91 93.05
11 Polymer Low High 50.13 92.31
import seaborn as sns
sns.catplot(x='MaterialType', y='YieldStrength', hue='ProductionSpeed', kind='bar',
data=merged_manufacturing)
sns.relplot(x='YieldStrength', y='ProductQuality', hue='ProductionSpeed',
kind='scatter', data=merged_manufacturing)
plt.title('Yield Strength vs. Product Quality by Production Speed')
Experimental Design in Python