Skip to content

inflation_history, fitting_distributions: state what pandas now warns about - #876

Draft
mmcky wants to merge 1 commit into
mainfrom
silence-pandas-deprecations
Draft

mmcky wants to merge 1 commit into
mainfrom
silence-pandas-deprecations

Conversation

@mmcky

@mmcky mmcky commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What

Two cells print a pandas warning into their output. This states what pandas asks for, keeping the results the same:

Lecture Before After The warning
inflation_history df_list.append(pd.concat(sheet_list, axis=1)) df_list.append(pd.concat(sheet_list, axis=1, sort=True)) Pandas4Warning: "Sorting by default when concatenating all DatetimeIndex is deprecated. In the future, pandas will respect the default of sort=False." sort=True keeps today's sorted result.
fitting_distributions monthly = times.dt.to_period('M').value_counts().sort_index() monthly = times.dt.tz_localize(None).dt.to_period('M').value_counts().sort_index() UserWarning: "Converting to PeriodArray/Index representation will drop timezone information." times is in UTC, so dropping the zone first gives the same months.

Both were found by the environment scan of 2026-11-19 and are in intro's own builds. This is part of reporting lecture fixes upstream to each lecture's source of truth (QuantEcon/project-monorepo#77).

Validation (draft until done)

A full validation, as for any change to a series that drives a live site (the owner, 2026-11-22): a fresh build with no cache and every lecture executed, of this pull request and of main on the same day. They are compared for new warnings in the build logs, for changed or new warnings and errors in the cell outputs, and page by page in the HTML.

The results go in a comment here.

This changes lecture content, so it needs a person's review.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL

… about

Two cells printed a pandas warning into their output:

- inflation_history: pd.concat of the sheets, which all have a
  DatetimeIndex, sorts the joined index by default, which pandas 3
  deprecates (Pandas4Warning: "Sorting by default when concatenating all
  DatetimeIndex is deprecated"). `sort=True` keeps today's sorted result.
- fitting_distributions: `times` is in UTC, and converting it to monthly
  periods drops the time zone, with a UserWarning. Dropping it first with
  `tz_localize(None)` gives the same months, without the warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL
@netlify

netlify Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for taupe-gaufre-c4e660 ready!

Name Link
🔨 Latest commit acff0f1
🔍 Latest deploy log https://app.netlify.com/projects/taupe-gaufre-c4e660/deploys/6b02c2510d9b17f7b03b12fe
😎 Deploy Preview https://deploy-preview-876--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.

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

This branch was successfully deployed

1 active deployment
pull request — acff0f1b Deployed Nov 22, 2026 by github-actions[bot]
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