Migrate polars visualize#62
Open
meshackamadi wants to merge 40 commits into
Open
Conversation
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.
…polars into brent-IMPORT
- 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.
…ts, enhancing clarity and consistency in code presentation.
Updated workflow-styles
- 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.
Brent programme
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.
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"