When your document uses multiple programming languages, the appendix can become difficult to navigate. The group-by-language option organizes code blocks by language, creating separate sections for Python, R, SQL, and so on.
This is particularly helpful for tutorials that compare implementations across languages, or for polyglot data science workflows.
Welch Two Sample t-test
data: treatment and control
t = 6.8766, df = 11.961, p-value = 1.735e-05
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
4.012867 7.737133
sample estimates:
mean of x mean of y
25.875 20.000
Effect Size
Back to Python to compute Cohen’s d:
# Cohen's d for effect sizeimport mathdef cohens_d(group1, group2): n1, n2 =len(group1), len(group2) mean1 =sum(group1) / n1 mean2 =sum(group2) / n2 var1 =sum((x - mean1)**2for x in group1) / (n1 -1) var2 =sum((x - mean2)**2for x in group2) / (n2 -1) pooled_std = math.sqrt(((n1-1)*var1 + (n2-1)*var2) / (n1+n2-2))return (mean1 - mean2) / pooled_stdd = cohens_d(treatment, control)print(f"Cohen's d = {d:.2f} (large effect)")
Welch Two Sample t-test
data: treatment and control
t = 6.8766, df = 11.961, p-value = 1.735e-05
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
4.012867 7.737133
sample estimates:
mean of x mean of y
25.875 20.000