Skip to content

Use scipy.stats t-distribution for confidence interval in day6_samples.py#88

Merged
EimanTahir071 merged 1 commit intoEimanTahir071-patch-2from
copilot/sub-pr-86
Mar 22, 2026
Merged

Use scipy.stats t-distribution for confidence interval in day6_samples.py#88
EimanTahir071 merged 1 commit intoEimanTahir071-patch-2from
copilot/sub-pr-86

Conversation

Copy link
Contributor

Copilot AI commented Mar 22, 2026

scipy.stats was imported but unused — the confidence interval relied on a hardcoded z-score (1.96) instead of leveraging the library.

Changes

  • Replace hardcoded z-score with t-critical value via stats.t.ppf(0.975, df=len(data) - 1), making the import meaningful and statistically appropriate for small samples
  • Correct variance formula from population variance (/ len(data)) to sample variance (/ (len(data) - 1))
# Before
z_score = 1.96
variance = sum((x - mean) ** 2 for x in data) / len(data)

# After
t_crit = stats.t.ppf(0.975, df=len(data) - 1)
variance = sum((x - mean) ** 2 for x in data) / (len(data) - 1)

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI mentioned this pull request Mar 22, 2026
Copilot AI changed the title [WIP] [WIP] Address feedback from PR #86 on file uploads Use scipy.stats t-distribution for confidence interval in day6_samples.py Mar 22, 2026
Copilot AI requested a review from EimanTahir071 March 22, 2026 04:52
Copy link
Owner

@EimanTahir071 EimanTahir071 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implement suggestions

@EimanTahir071 EimanTahir071 marked this pull request as ready for review March 22, 2026 04:53
Copilot AI review requested due to automatic review settings March 22, 2026 04:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@EimanTahir071 EimanTahir071 merged commit 2148577 into EimanTahir071-patch-2 Mar 22, 2026
1 check passed
@EimanTahir071 EimanTahir071 deleted the copilot/sub-pr-86 branch March 22, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants