Skip to content

[pandas_panel] Take programming's text, so both series publish one lecture - #1088

Merged
mmcky merged 2 commits into
mainfrom
merge/pandas-panel-from-programming
Oct 12, 2026
Merged

mmcky merged 2 commits into
mainfrom
merge/pandas-panel-from-programming

Conversation

@mmcky

@mmcky mmcky commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Makes pandas_panel one lecture that programming and intermediate both publish: this series' copy is replaced by programming's text, byte for byte. John and Matt decided this on 2026-10-12 (QuantEcon/project-monorepo#110).

Why. The two copies were the same lecture, with the same sections and exercises and 97% identical text, but drifting apart. Programming's carries the pandas 3.0 update (QuantEcon/lecture-python-programming#470) and the August tidy-ups (QuantEcon/lecture-python-programming#595), which never reached this copy. From now on a change is made once, in programming, and copied here.

What changes for readers of this series.

  • The code: the pandas 3.0 forms (stack() without future_stack, a note on .T with groupby), one replace call in place of a loop, imports at the top, and the data read from raw.githubusercontent.com.
  • The average-by-continent table prints the other way round (continents as rows).
  • The link to the pandas lecture is now {doc}`pandas`. It resolves to python-programming.quantecon.org, as the old hard-coded address did.

The one configuration line. intersphinx_disabled_reftypes: [] lets a reference with no target in this site resolve through intersphinx, here to programming's pandas, which no other mapped site has. Every other reference in the series already resolves locally (the build runs -n -W), so nothing else moves. This is the line the lecture monorepo puts in every product.

One sentence fixed in both copies. Copilot noticed that the sentence above the continent recoding still said "loop through a list", though the code makes a single .replace() call. It is fixed here (d72d499) and identically in programming, QuantEcon/lecture-python-programming#645: merge that one first, or together with this, so the copies match.

Follow-up in the Chinese edition. When this merges, the translation sync opens a pull request in QuantEcon/lecture-python.zh-cn. That edition also builds with -n -W, so its lectures/_config.yml needs the same line, added by hand to the sync pull request (as with the rename redirects on 2026-10-09).

🤖 Generated with Claude Code

…cture

Programming and intermediate both publish pandas_panel. The two copies
were the same lecture drifting apart: programming's carries the pandas
3.0 update and later tidy-ups that never reached this copy. John and
Matt decided on 2026-10-12 to publish one text (project-monorepo#110),
so this copy becomes programming's, byte for byte.

Programming's text links to its pandas lecture with {doc}`pandas`,
which this site does not have. intersphinx_disabled_reftypes: [] lets
a reference with no local target resolve through intersphinx, here to
python-programming.quantecon.org. Every other reference in this series
already resolves locally (the build runs -n -W), so nothing else moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

📖 Netlify Preview Ready!

Preview URL: https://pr-1088--sunny-cactus-210e3e.netlify.app

Commit: d72d499

📚 Changed Lectures


Build Info

@mmcky
mmcky marked this pull request as ready for review October 12, 2026 00:48
Copilot AI balanced review requested due to automatic review settings October 12, 2026 00:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The vectorized .replace() rewrite leaves the preceding sentence ("loop through a list") describing behavior the code no longer performs, a prose/code inconsistency worth correcting (ideally upstream to preserve the intended sync).

1 open finding
What changed in this PR

This PR makes lectures/pandas_panel.md a single lecture that both the "programming" and "intermediate" series publish, by replacing this series' copy with the programming version's text (which carries the pandas 3.0 updates and earlier tidy-ups). A one-line Sphinx config change (intersphinx_disabled_reftypes: []) lets the in-page {doc}pandas`` reference resolve to the programming site via intersphinx, since there is no local pandas.md.

Changes:

  • Adopt programming's pandas 3.0 code forms (stack() without future_stack, a single vectorized .replace() instead of a loop, top-level imports, a .T/groupby note) and read data from raw.githubusercontent.com.
  • Replace the hard-coded pandas link with {doc}earlier lecture on pandas `` and transpose the average-by-continent output so continents are rows.
  • Add intersphinx_disabled_reftypes: [] to lectures/_config.yml so a reference with no local target resolves through intersphinx.
File Description
lectures/​pandas_panel.md Replaces the lecture body with programming's copy: pandas 3.0 API usage, top imports, {doc} cross-reference, updated data URLs, and a transposed continent aggregation.
lectures/​_config.yml Enables intersphinx fallback for untargeted references so {doc}pandas`` resolves to the programming site.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lectures/pandas_panel.md Outdated
The sentence above the continent recoding still said we "loop through a
list", but the code makes one .replace() call with the whole list. Say
what the code does, and end the sentence with a full stop.

Programming takes the identical change, so the two copies stay
byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mmcky
mmcky merged commit 977a9fe into main Oct 12, 2026
2 checks passed
@mmcky
mmcky deleted the merge/pandas-panel-from-programming branch October 12, 2026 01:30
@mmcky

mmcky commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

✅ Translation sync completed (zh-cn)

Target repo: QuantEcon/lecture-python.zh-cn
Translation PR: QuantEcon/lecture-python.zh-cn#293
Files synced (1):

  • lectures/pandas_panel.md

mmcky added a commit to QuantEcon/lecture-python-programming that referenced this pull request Oct 12, 2026
The pandas 3.0 update replaced the loop over continent names with one
.replace() call taking the whole list, but the sentence above it still
said we "loop through a list". Say what the code does, and end the
sentence with a full stop.

Intermediate publishes this lecture too; its copy takes the same change
in QuantEcon/lecture-python.myst#1088, so the two stay byte-identical.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
mmcky added a commit to QuantEcon/lecture-python.zh-cn that referenced this pull request Oct 12, 2026
pandas_panel now links to programming's pandas lecture with
{doc}`pandas`, which this site does not have, and the build runs
-n -W. intersphinx_disabled_reftypes: [] lets a reference with no local
target resolve through intersphinx (here the pyprog mapping), as
QuantEcon/lecture-python.myst#1088 did for the English edition. Every
other reference already resolves locally, so nothing else moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mmcky added a commit to QuantEcon/lecture-python.zh-cn that referenced this pull request Oct 12, 2026
The source (QuantEcon/lecture-python.myst#1088) moved its imports into
a new top cell and deleted its mid-lecture import cell. In this edition
that cell also set the Source Han Serif font and loaded country_map,
the Chinese country names, so the sync removed both: the bar-chart cell
raised NameError: name 'country_map' is not defined, and every figure
lost its Chinese font.

Put the font setup in the new top import cell, as this edition's other
lectures do, and load country_map at the top of the bar-chart cell,
which keeps 47 code cells, the same as the source. The whole lecture
now executes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mmcky added a commit to QuantEcon/lecture-python.zh-cn that referenced this pull request Oct 12, 2026
…series publish one lecture (#293)

* Update translation: lectures/pandas_panel.md

* Update translation: .translate/state/pandas_panel.md.yml

* Resolve pandas_panel's link to the pandas lecture through intersphinx

pandas_panel now links to programming's pandas lecture with
{doc}`pandas`, which this site does not have, and the build runs
-n -W. intersphinx_disabled_reftypes: [] lets a reference with no local
target resolve through intersphinx (here the pyprog mapping), as
QuantEcon/lecture-python.myst#1088 did for the English edition. Every
other reference already resolves locally, so nothing else moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Restore the CJK font setup and country_map that the sync dropped

The source (QuantEcon/lecture-python.myst#1088) moved its imports into
a new top cell and deleted its mid-lecture import cell. In this edition
that cell also set the Source Han Serif font and loaded country_map,
the Chinese country names, so the sync removed both: the bar-chart cell
raised NameError: name 'country_map' is not defined, and every figure
lost its Chinese font.

Put the font setup in the new top import cell, as this edition's other
lectures do, and load country_map at the top of the bar-chart cell,
which keeps 47 code cells, the same as the source. The whole lecture
now executes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants