Skip to content

feat: convert tidy data chapter from pandas to Polars#9

Open
meshackamadi wants to merge 1 commit into
mainfrom
tidydata-conversion-to-polars
Open

feat: convert tidy data chapter from pandas to Polars#9
meshackamadi wants to merge 1 commit into
mainfrom
tidydata-conversion-to-polars

Conversation

@meshackamadi

Copy link
Copy Markdown
Collaborator

Summary

This PR converts the Tidy Data chapter from pandas to Polars and updates the accompanying explanations to align with the Polars API and data model.

Changes

  • Replaced pandas examples with their Polars equivalents.
  • Updated reshaping examples to use unpivot() instead of melt().
  • Updated pivot() examples to use the Polars API (on= instead of columns=).
  • Replaced pd.read_parquet() with pl.read_parquet().
  • Replaced DataFrame creation examples with pl.DataFrame.
  • Updated text throughout the chapter to reference Polars instead of pandas.
  • Removed pandas index-based operations where Polars has no equivalent.
  • Revised explanations to reflect Polars' expression-based workflow.

Documentation updates

  • Updated prerequisites to use Polars.
  • Renamed the reshaping tools section to reference Polars.
  • Improved explanations of tidy data using Polars terminology.

Notes

Testing

  • All notebook cells execute successfully.
  • Quarto renders successfully.
  • pre-commit run --all-files passes.

@meshackamadi meshackamadi requested a review from ugohuche July 16, 2026 20:37
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