Skip to content

Migrate polars visualize#62

Open
meshackamadi wants to merge 40 commits into
aeturrell:mainfrom
datathink:migrate-polars-visualize.qmd
Open

Migrate polars visualize#62
meshackamadi wants to merge 40 commits into
aeturrell:mainfrom
datathink:migrate-polars-visualize.qmd

Conversation

@meshackamadi

Copy link
Copy Markdown

This PR migrates the vis-layers.ipynb chapter from pandas to polars as part of the ongoing effort to convert the entire codebase to use Polars DataFrames.

Summary of Changes
Code Migration
Replaced pandas with polars as the primary DataFrame library

Updated data loading: pd.read_csv() → pl.read_csv()

Updated column type casting: df.astype() → df.with_columns(pl.col().cast())

Updated filtering: df.loc[condition] → df.filter(pl.col() == value)

Updated categorical types: pd.CategoricalDtype() → pl.Enum() for ordered categories

Updated group and aggregate: df.value_counts() → df.group_by().agg(pl.len())

Updated data filtering for layer-specific data in ggplot layers

Text Updates
Prerequisites section: Changed "pandas" → "polars"

hathawayj and others added 30 commits April 14, 2026 15:26
Removed duplicate sentences and improved clarity of the introduction. Updated contributor list formatting.
WIP: Data Transformation
…pis.ipynb, updating relevant code and documentation accordingly.
…help.quarto_ipynb_1, and workflow-packages-and-environments.quarto_ipynb_1.
…onsistency

- Changed `quarto render` command in GitHub Actions from `--no-execute` to `--execute` for proper rendering.
- Enhanced readability in `data-transform.ipynb` by removing unnecessary line breaks and simplifying code expressions.
- Added missing import statement for `polars` in `data-visualise.ipynb`.
- Improved code formatting and consistency across various cells in both notebooks.
- Import `lets_plot` at the beginning for clarity.
- Adjust DataFrame column operations for better readability.
- Simplify plot creation by using parentheses for chaining.
- Remove unnecessary imports and whitespace for cleaner code.
…pis.ipynb, updating relevant code and documentation accordingly.
…help.quarto_ipynb_1, and workflow-packages-and-environments.quarto_ipynb_1.
…help.quarto_ipynb_1, and workflow-packages-and-environments.quarto_ipynb_1.
- Added newline characters to the end of several text blocks in `webscraping-and-apis.ipynb` to ensure proper formatting.
- Adjusted the structure of code snippets for better clarity and consistency.
- Removed unnecessary lines and streamlined code for better presentation.
Convert Import Section of Python4DS to Polars
…display for functions, and correct code snippets for clarity. Adjusted execution counts and fixed minor documentation errors.
…ith polars

- Updated import statements and function calls in data-import.ipynb to use polars instead of pandas.
- Adjusted text descriptions to reflect the changes from pandas to polars, including installation instructions and function usage.
- Cleaned up markdown formatting for better readability.
- Removed unnecessary sections and streamlined explanations in data-transform.ipynb.
ugohuche and others added 10 commits April 24, 2026 19:48
…ts, enhancing clarity and consistency in code presentation.
- Added execution counts to various code cells across multiple notebooks for better tracking of code execution.
- Enhanced output displays in `boolean-data.ipynb`, `categorical-data.ipynb`, `communicate-plots.ipynb`, `data-import.ipynb`, `data-tidy.ipynb`, `data-transform.ipynb`, and `data-visualise.ipynb` to provide clearer results and visualizations.
- Improved overall consistency in notebook formatting and presentation.
- Updated the command line chapter in `command-line.md` to improve formatting by replacing asterisks with underscores for emphasis.
- Modified output displays in `functions.ipynb` and `iteration.ipynb` to reflect new data and execution counts, ensuring consistency and clarity in results.
- Adjusted various execution counts across notebooks to maintain accurate tracking of code execution.
- Updated execution counts to null and cleared outputs in `boolean-data.ipynb`, `categorical-data.ipynb`, `communicate-plots.ipynb`, `data-import.ipynb`, `data-tidy.ipynb`, `data-transform.ipynb`, and other notebooks for a cleaner presentation.
- Enhanced overall consistency in notebook formatting by removing previous output displays, ensuring a more streamlined user experience.
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.

4 participants