Skip to content

Improve PQK tutorial, closes 5604 - #5608

Open
Soyoung Shin (0sophy1) wants to merge 8 commits into
Qiskit:mainfrom
0sophy1:main
Open

Improve PQK tutorial, closes 5604#5608
Soyoung Shin (0sophy1) wants to merge 8 commits into
Qiskit:mainfrom
0sophy1:main

Conversation

@0sophy1

Copy link
Copy Markdown
Member
  1. Pure-Python download — Replaced wget shell commands with urllib.request; works anywhere without external tools.
  2. All 4 files fetched — Added projections_train.csv and projections_test.csv to the download list.
  3. CSV sanitization — Strips BOMs, stray quotes, and normalizes whitespace-delimited files to proper CSV.
  4. Correct data path — dir_root now points to the actual download directory instead of "./".
  5. Fixed projection loading — Loads .csv (not nonexistent .txt) with a header-aware helper function.

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@qiskit-bot

Copy link
Copy Markdown
Contributor

One or more of the following people are relevant to this code:

  • @MeltemTolunay
  • @nathanearnestnoble

Henry Zou (henryzou50) added a commit to henryzou50/documentation that referenced this pull request Sep 8, 2026
The four CSVs under datasets/tutorials/pqk/ had a UTF-8 BOM, CRLF line
endings, and every line of train_data.csv and test_data.csv wrapped in
double quotes. pandas read each row as a single string column of NaNs,
and np.loadtxt rejected the BOM. The tutorial's stored output (14:0:15)
shows the author's original data parsed correctly, so the files were
mangled on export.

Rewrite them as plain UTF-8 with LF line endings and no wrapping
quotes. Values are unchanged.

The notebook-side fixes (download path, projections file names, urllib
instead of wget) are handled in Qiskit#5608.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Henry Zou (henryzou50) added a commit to henryzou50/documentation that referenced this pull request Sep 8, 2026
The four CSVs under datasets/tutorials/pqk/ had a UTF-8 BOM, CRLF line
endings, and every line of train_data.csv and test_data.csv wrapped in
double quotes. pandas read each row as a single string column of NaNs,
and np.loadtxt rejected the BOM. The tutorial's stored output (14:0:15)
shows the author's original data parsed correctly, so the files were
mangled on export.

Rewrite them as plain UTF-8 with LF line endings and no wrapping
quotes. Values are unchanged.

The notebook-side fixes (download path, projections file names, urllib
instead of wget) are handled in Qiskit#5608.

@henryzou50 Henry Zou (henryzou50) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Sophy! I just tested it and LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Improve PQK tutorial data download and pre-process for broader machine compatibility

3 participants