Skip to content

fix: add missing quotes around species column in aes() exercise code - #69

Open
Jah-yee wants to merge 1 commit into
aeturrell:mainfrom
Jah-yee:fix/species-quote-typo
Open

Jah-yee wants to merge 1 commit into
aeturrell:mainfrom
Jah-yee:fix/species-quote-typo

Conversation

@Jah-yee

@Jah-yee Jah-yee commented Aug 17, 2026

Copy link
Copy Markdown

Summary

In the Data Visualisation chapter's exercises section, the example code uses which in Python's plotnine would attempt to reference a variable named rather than the column named .

Changed:

  • →

Files changed:

Affected lines (706, 709):

  • Exercise 2 code blocks now correctly use with the string column name, matching how the rest of the chapter uses quoted column names.

This is a single-commit PR with a minimal, surgical fix per the project guidelines.

@Jah-yee

Jah-yee commented Aug 17, 2026

Copy link
Copy Markdown
Author

Hi! This PR fixes the missing quotes around species in the aes() calls in the exercise code. In Python's plotnine, column names must be quoted strings. Happy to make any adjustments!

@Jah-yee

Jah-yee commented Oct 22, 2026

Copy link
Copy Markdown
Author

Update (2026-10-22): I found a bug in my own commit — the added quotes inside the notebook JSON string were unescaped, which makes data-visualise.ipynb fail to parse (JSONDecodeError at line 706). I've amended the commit to escape them as \"species\" so the notebook stays valid JSON while the rendered code still shows aes(x = "species"). The fix is now live on the fix/species-quote-typo branch (commit 91e9ec0). Let me know if you'd like me to adjust anything else!

In data-visualise.ipynb the aes() calls passed the bare column name
species, but plotnine requires column names to be quoted strings, so the
snippet raised a NameError. Both aes(x = species) occurrences now read
aes(x = "species"), with the inner quotes escaped so the notebook stays
valid JSON.

Signed-off-by: Jah-yee <166608075+Jah-yee@users.noreply.github.com>
@Jah-yee
Jah-yee force-pushed the fix/species-quote-typo branch from 91e9ec0 to 8bfe8ec Compare October 22, 2026 12:12

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant