Skip to content

Sync pandas-intro with the updated tutorial - #939

Open
realpython-bot wants to merge 1 commit into
masterfrom
maintenance/pandas-python-explore-dataset-20261109
Open

realpython-bot wants to merge 1 commit into
masterfrom
maintenance/pandas-python-explore-dataset-20261109

Conversation

@realpython-bot

@realpython-bot realpython-bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Syncs pandas-intro/ with the maintenance update of Using pandas and Python to Explore Your Dataset for pandas 3.

What changed in pandas_intro.ipynb:

  • Install command pinned to the tested versions: requests==2.34.*, pandas==3.1.*, matplotlib==3.11.*
  • city_revenues[1] and city_revenues[-1] cells removed. Since pandas 3.0, Series.__getitem__ treats integer keys as labels, so both raise KeyError on a string index. The tutorial now points to .iloc instead.
  • fillna(..., inplace=True) on a selected column replaced with assignment. Under Copy-on-Write it never updated the DataFrame.
  • nba.describe(include=object) → include="str". The old form emits a Pandas4Warning on pandas 3.1.
  • Expected-output comments updated for .value_counts() (column header, Name: count) and np.int64(8000)
  • Long download_url line wrapped to match the article

Draft article: https://realpython.com/pbjt/blog/post/2627/change/ (preview: https://realpython.com/pandas-python-explore-dataset-update/)
Maintenance card: https://trello.com/c/13Nmm2CS

Verification: Executed the whole notebook with nbclient on Python 3.15.1, pandas 3.1.1, matplotlib 3.11.2, and requests 2.34.2 (MPLBACKEND=Agg). All cells ran without errors, and the fillna cell now reports top: no notes at all. ruff@0.14.1 format --check and ruff check pass on pandas-intro/.

Known leftover, matching the article: df.drop(elo_columns, inplace=True, axis=1) emits a Pandas4Warning (inplace deprecation, PDEP-8). That's flagged for the article's full update.

🤖 Generated with Claude Code

…hon to Explore Your Dataset

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

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

1 participant