Conversation
The notebook now covers the full arc of src/prepare_sales.py and src/analyze_sales.py, from loading the raw CSV through cleaning, describing, grouping, and charting, so it runs without the scripts. Drop the parent-directory fallback and use PROJECT_ROOT to match the tutorial's code blocks. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
requires-python in pyproject.toml and the lockfile already constrain the interpreter to 3.14, and the tutorial has the reader pick 3.14 in Positron's Create Environment flow. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Match the folder name, the branch, and the tutorial slug. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The notebook holds the cleaned DataFrame in memory, so it no longer writes data/sales_clean.csv or reads it back. The analysis cells work from clean_sales directly. The scripts still use the CSV to hand data from prepare_sales.py to analyze_sales.py. Pin Matplotlib to 3.11.2 to match the version the tutorial states. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Positron starts a session in the folder holding the file, so Path.cwd() pointed at src/ or notebooks/ and the data path missed by one level. Use Path.cwd().parent in both scripts and the notebook, and document running them from their own folder. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The tutorial no longer walks through nlargest, so remove it from the script and the notebook. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Positron's Console starts at the workspace root, so the scripts use Path.cwd(). A notebook kernel starts in the notebook's own folder, so the notebook keeps Path.cwd().parent. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The tutorial doesn't cover it, so the script's last cell is now just the to_csv call and the notebook goes straight from cleaning to the analysis. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The tutorial no longer covers installing an external package, so the interactive chart cell and its uv add instructions are gone. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Where to put new files:
my-awesome-articleHow to merge your changes:
Sample code for Positron IDE: A Hands-on Python Tutorial, revised in CMS post 2375. The
positron-ide/folder contains the sales-data preparation and analysis scripts, a Jupyter notebook, the original 5,130-row dataset with attribution and its Apache 2.0 license, and a reproducible starting environment.The examples inspect and prepare the data, summarize its distribution, compare median retail and wholesale order values by product category, and create Matplotlib and Plotly charts. Plotly is intentionally added during the tutorial; it is absent from the starting dependency files. Notebook outputs are cleared.
This is a separate replacement proposal for the earlier bike-share materials in #822. That PR remains open and unchanged.
Validation: preparation and analysis scripts run successfully against the supplied CSV; the notebook was executed in a fresh kernel, including Plotly, before clearing outputs. Ruff 0.14.1 formatting and lint checks pass. Positron GUI steps and screenshots remain part of the article review.