Skip to content

Fix inequality data notebook with pandas 3 - #860

Open
maydalabs wants to merge 1 commit into
QuantEcon:mainfrom
maydalabs:codex/fix-inequality-notebook-pandas3
Open

maydalabs wants to merge 1 commit into
QuantEcon:mainfrom
maydalabs:codex/fix-inequality-notebook-pandas3

Conversation

@maydalabs

Copy link
Copy Markdown

The downloadable inequality data notebook still used a read-only NumPy view of a pandas Series, so random.shuffle failed under pandas 3. Make a writable copy, matching the fix already in inequality.md.

Addresses the notebook crash reported in #835.

I reproduced the failure on the original notebook, then ran the patched notebook end to end with the full SCF dataset: 509,455 rows, 20 years and all three income/wealth measures. All 60 Gini values matched an independent calculation within floating-point tolerance. Validation used Python 3.13.17, pandas 3.0.5, NumPy 2.5.2 and QuantEcon 0.13.1.

This fixes the crash only. The broader question of executing static notebooks in CI remains open; I did not run the full lecture-book build.

Assisted-by: Codex (GPT-6)

Make a writable copy before shuffling, matching inequality.md.

Assisted-by: Codex (GPT-6)
@netlify

netlify Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for taupe-gaufre-c4e660 ready!

Name Link
🔨 Latest commit f374d7f
🔍 Latest deploy log https://app.netlify.com/projects/taupe-gaufre-c4e660/deploys/6aea3fd44b3b30671438b895
😎 Deploy Preview https://deploy-preview-860--taupe-gaufre-c4e660.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

This branch has not been deployed

No deployments
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.

1 participant