Draft
Fix deprecated APIs, runtime errors, and logic bugs in data analysis notebooks#3
Conversation
- pandas/ch3.ipynb: Replace nested loop with vectorized map(), fix deprecated applymap() calls (x2), fix func_01 logic error - data_analysis/Ch5.ipynb: Add None check for match().group(1), fix BeautifulSoup find_all syntax error - data_analysis/Ch4.ipynb: Make Cell 25 self-contained by adding headers definition Co-authored-by: ItsAyaya <79414931+ItsAyaya@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve model accuracy and fix errors in project
Fix deprecated APIs, runtime errors, and logic bugs in data analysis notebooks
Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several notebooks contained broken cells that crash on execution due to deprecated pandas APIs, Python syntax errors, and logic errors that silently discard computed results.
pandas/ch3.ipynbdf.map()(100–1000× faster)DataFrame.applymap()removed in pandas 2.x →DataFrame.map()func_01was applied to a column subset — the new销售毛利率column was computed but never persisted back todatadata_analysis/Ch5.ipynbpair.match("718ak")returnsNone(no pair); chaining.group(1)directly crashes the kernel withAttributeError→ guarded withm.group(1) if m else Nonefind_all(data-foo="value")is a Python syntax error (hyphen in keyword arg) →find_all(attrs={'data-foo': 'value'})data_analysis/Ch4.ipynbheaderswas defined in Cell 23, causingNameErrorwhen Cell 25 runs independently → movedheadersdefinition into Cell 25Original prompt
创建自 VS Code。
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.