Skip to content

🌐 [translation-sync] [pandas_panel] Take programming's text, so both series publish one lecture - #293

Merged
mmcky merged 4 commits into
mainfrom
translation-sync-2026-10-12T01-31-37-pr-1088
Oct 12, 2026
Merged

mmcky merged 4 commits into
mainfrom
translation-sync-2026-10-12T01-31-37-pr-1088

Conversation

@mmcky

@mmcky mmcky commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Automated Translation Sync

This PR contains automated translations from QuantEcon/lecture-python.myst.

Source PR

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

Files Updated

  • ✏️ lectures/pandas_panel.md
  • ✏️ .translate/state/pandas_panel.md.yml

Details

  • Source Language: en
  • Target Language: zh-cn
  • Model: claude-sonnet-5

This PR was created automatically by the translation action.

Copilot AI balanced review requested due to automatic review settings October 12, 2026 01:31
@mmcky mmcky added action-translation PRs created by QuantEcon/action-translation automated Automated sync PR opened by action-translation labels Oct 12, 2026
@netlify

netlify Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for astonishing-narwhal-a8fc64 ready!

Name Link
🔨 Latest commit 13c2647
🔍 Latest deploy log https://app.netlify.com/projects/astonishing-narwhal-a8fc64/deploys/6acc58a1ad63800009cdc701
😎 Deploy Preview https://deploy-preview-293--astonishing-narwhal-a8fc64.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 Oct 12, 2026 •

Copy link
Copy Markdown

✅ Translation Quality Review

Verdict: PASS | Model: claude-sonnet-5 | Date: 2026-10-12
Routing: editor — 1 minor finding(s) in gating categories (accuracy/terminology/syntax/diff-check/other); accuracy 8 below floor 9; terminology 8 below floor 9; formatting 7 below floor 8
Shadow gate: would NOT auto-merge (recorded only; no action taken)


📝 Translation Quality

Criterion Score
Accuracy 8/10
Fluency 9/10
Terminology 8/10
Formatting 7/10
Overall 8.1/10

Summary: 翻译整体质量较高,准确传达了原文关于Pandas面板数据处理的技术内容,术语使用基本遵循术语表规范,中文表达流畅自然。主要问题在于译文为适配中文可视化环境,在部分代码块中新增了原文没有的字体设置和中英翻译映射逻辑,这类技术性新增虽然服务于本地化目的,但使得译文与原文的代码不完全对应,建议在评估/维护流程中对此类必要的本地化代码变更做特别说明。个别标点符号使用不规范(英文破折号),属于轻微问题。 专业术语翻译准确一致,如MultiIndex、DataFrame、groupby等保留英文原名并辅以恰当的中文解释 长句拆分合理,技术说明清晰易懂,符合中文学术写作习惯 代码块与原文结构完整对应,注释翻译准确到位

Suggestions:

  • [minor · accuracy] lectures/pandas_panel.md — ## 合并数据框和填充空值(NaN 值): 英文原文为 'discard countries in worlddata that do not have a corresponding data entry realwage_f',译文'丢弃worlddata中不能和realwage_f相匹配的国家'意思基本正确,但略微改写了原意(原文强调的是数据条目对应关系),属于轻微的释义性翻译,不影响理解。 → 丢弃worlddata中没有对应realwage_f数据条目的国家
  • [minor · formatting] lectures/pandas_panel.md — 导入语句 import matplotlib as mpl ... FONTPATH: 译文在'我们使用以下导入语句'代码块中新增了英文源文档中不存在的字体设置代码(FONTPATH、mpl.font_manager等),这超出了单纯翻译范围,属于内容新增。虽然这可能是为了支持中文绘图显示而特意添加,但评估时应注意这类新增代码块并非原文的直接翻译,建议在后续审阅中确认此类技术性新增是否符合项目规范。
  • [minor · formatting] lectures/pandas_panel.md — ## 数据分组和汇总 - 绘图代码块: 译文在多处绘图代码块中增加了英文原文没有的中文国家/大洲名称映射字典及相关转换逻辑(如 country_map、continent_map、age_labels),这些是为了适配中文可视化而添加的内容,不属于纯翻译,但会使读者难以对照原文核实代码的一致性。建议在翻译说明中标注此类必要的本地化代码改动。
  • [nit · fluency] lectures/pandas_panel.md — 我们把美洲合并成一个大洲 -- 这样可以让我们后面的可视化效果更好。: 此处使用了英文破折号'--'而非中文全角破折号或其他标点,不符合中文标点规范(全角标点要求)。 → 我们把美洲合并成一个大洲,这样可以让我们后面的可视化效果更好。
  • [nit · terminology] lectures/pandas_panel.md — ## 切片和重塑数据 - 'pivot_table的参数需要指定数据值(values)...': '数据(values)'括注英文变量名的做法在文中不一致,有的地方保留英文术语不加括注(如'index'、'columns'直接使用英文),有的地方加中文括注,风格可以更统一,但不影响理解,属于风格问题。

🔍 Diff Quality

Check Status
Scope Correct ✅
Position Correct ✅
Structure Preserved ✅
Heading-map Correct ✅
Overall 10/10

Summary: All source code/structural changes (anchor repositioning, URL updates, stack() signature changes, import reorganization, replace() simplification, groupby.T fix) are correctly mirrored in the target document at matching positions.


This review was generated automatically by action-translation review mode.

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

mmcky commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Added 5c74f14 by hand: intersphinx_disabled_reftypes: [] in lectures/_config.yml. The translated pandas_panel keeps the link to programming's pandas lecture ({doc} with target pandas), which this site does not have, and the build runs -n -W. The line lets that reference resolve through the pyprog intersphinx mapping, as QuantEcon/lecture-python.myst#1088 did for the English edition. Every other reference already resolves locally, so nothing else changes.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The sync removes the Chinese font configuration and the still-referenced country_map definition (causing a NameError and missing-glyph labels) and adds a {doc} cross-reference to a document that does not exist in this repository.

2 open findings
What changed in this PR

This PR is an automated translation sync that updates the Chinese lecture lectures/pandas_panel.md to match upstream English source PR QuantEcon/lecture-python.myst#1088, whose goal is to make one pandas_panel lecture publishable across both the programming and advanced series. It brings the translated content in line with the restructured source (moved anchor, new install/import cells, modernized pandas API usage, and updated data URLs) and refreshes the translation state metadata.

Changes:

  • Syncs structural/API updates from the source: relocates the (ppd)= label, adds the seaborn install + imports cells, removes deprecated future_stack=True from .stack() calls, and adjusts the groupby transpose pattern.
  • Normalizes data-file URLs to raw.githubusercontent.com and converts the intro-pandas link to a {doc} reference.
  • Updates .translate/state/pandas_panel.md.yml (source-sha, synced-at, mode RESYNC→UPDATE, tool-version).
File Description
lectures/​pandas_panel.md Syncs content/API changes from the English source; however it drops the Chinese font config and country_map definition (still used downstream) and introduces a {doc} reference to a lecture not present in this repo.
.translate/​state/​pandas_panel.md.yml Updates translation-sync tracking metadata (source-sha, synced-at date, mode, tool-version).

🧠 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
Comment on lines +47 to 51
```{code-cell} ipython3
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_theme()
```
Comment thread lectures/pandas_panel.md
## 概述

在[之前关于pandas的讲座](https://python-programming.quantecon.org/pandas.html)中,我们学习了如何处理简单的数据集。
在{doc}`之前关于pandas的讲座 <pandas>`中,我们学习了如何处理简单的数据集。
@github-actions
github-actions Bot temporarily deployed to pull request October 12, 2026 01:44 Inactive
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

mmcky commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Fixed by hand in 13c2647. The sync had removed the edition's CJK font setup and the country_map load, so the lecture failed to execute.

What went wrong. The source moved its imports into a new top cell and deleted its mid-lecture import cell (QuantEcon/lecture-python.myst#1088). In this edition, that cell also set the Source Han Serif font and loaded country_map from this repository's _static/country_map.csv, and the sync deleted it with the rest.

  • The bar-chart cell raised NameError: name 'country_map' is not defined. The preview build logged pandas_panel.md: WARNING: Executing notebook failed: CellExecutionError (run 38192526158). The preview check passes even so, because it does not treat warnings as errors.
  • Every figure lost its Chinese font.

The fix.

  • The font setup goes in the new top import cell, as in this edition's other lectures.
  • country_map is loaded at the top of the bar-chart cell. That keeps 47 code cells, the same as the source.

Executed end to end, the fixed file runs all 47 cells; the unfixed file stops at the NameError.

On the quality review above:

  • Its country_map finding is real, but the cause is the deleted definition, not added code.
  • Its other findings do not hold. The continent_map and age_labels code is this edition's own localisation, present before this sync. All four future_stack calls were converted. The setup and imports blocks are present. jupytext_version matches the source.
  • It missed the lost font.

These are reported upstream as evidence on QuantEcon/action-translation#182, QuantEcon/action-translation#253 and QuantEcon/action-translation#224.

This branch was successfully deployed

1 active deployment
pull request — 13c26471 Deployed Oct 12, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action-translation PRs created by QuantEcon/action-translation automated Automated sync PR opened by action-translation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants