-
-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update 14-looping-data-sets.md #667
Conversation
If you run the original command, print(p.parent), print(p.stem), print(p.suffix) The output is, data gapminder_gdp_africa .csv (None, None, None) The last line is confusing, "(None, None, None)" You're essentially doing three separate print calls and then creating a tuple with their return values. The print function in Python doesn't return any meaningful value (it returns None), so when you group them together with commas, you're creating a tuple of their return values, which is (None, None, None). To get a clean output like you see in the lessons, you have to write the print statement on three separate lines.
Thank you!Thank you for your pull request 😃 🤖 This automated message can help you check the rendered files in your submission for clarity. If you have any questions, please feel free to open an issue in {sandpaper}. If you have files that automatically render output (e.g. R Markdown), then you should check for the following:
Rendered Changes🔍 Inspect the changes: https://github.com/swcarpentry/python-novice-gapminder/compare/md-outputs..md-outputs-PR-667 The following changes were observed in the rendered markdown documents:
What does this mean?If you have source files that require output and figures to be generated (e.g. R Markdown), then it is important to make sure the generated figures and output are reproducible. This output provides a way for you to inspect the output in a diff-friendly manner so that it's easy to see the changes that occur due to new software versions or randomisation. ⏱️ Updated at 2023-10-17 12:27:20 +0000 |
Agreed, thanks for the PR! |
Auto-generated via {sandpaper} Source : fd81e1e Branch : main Author : Allen Lee <[email protected]> Time : 2024-03-05 21:00:11 +0000 Message : Merge pull request #667 from wgriffa/patch-4 separate print statements for clarity and avoid tuple-izing them for convenience
Auto-generated via {sandpaper} Source : f02b0bd Branch : md-outputs Author : GitHub Actions <[email protected]> Time : 2024-03-05 21:01:09 +0000 Message : markdown source builds Auto-generated via {sandpaper} Source : fd81e1e Branch : main Author : Allen Lee <[email protected]> Time : 2024-03-05 21:00:11 +0000 Message : Merge pull request #667 from wgriffa/patch-4 separate print statements for clarity and avoid tuple-izing them for convenience
Auto-generated via {sandpaper} Source : f02b0bd Branch : md-outputs Author : GitHub Actions <[email protected]> Time : 2024-03-05 21:01:09 +0000 Message : markdown source builds Auto-generated via {sandpaper} Source : fd81e1e Branch : main Author : Allen Lee <[email protected]> Time : 2024-03-05 21:00:11 +0000 Message : Merge pull request #667 from wgriffa/patch-4 separate print statements for clarity and avoid tuple-izing them for convenience
If you run the original command,
print(p.parent), print(p.stem), print(p.suffix)
The output is,
data
gapminder_gdp_africa
.csv
(None, None, None)
The last line is confusing, "(None, None, None)"
You're essentially doing three separate print calls and then creating a tuple with their return values. The print function in Python doesn't return any meaningful value (it returns None), so when you group them together with commas, you're creating a tuple of their return values, which is (None, None, None).
To get a clean output like you see in the lessons, you have to write the print statement on three separate lines.
If this pull request addresses an open issue on the repository, please add 'Closes #NN' below, where NN is the issue number.
Please briefly summarise the changes made in the pull request, and the reason(s) for making these changes.
If any relevant discussions have taken place elsewhere, please provide links to these.
For more guidance on how to contribute changes to a Carpentries project, please review the Contributing Guide and Code of Conduct.
Please keep in mind that lesson Maintainers are volunteers and it may be some time before they can respond to your contribution. Although not all contributions can be incorporated into the lesson materials, we appreciate your time and effort to improve the curriculum. If you have any questions about the lesson maintenance process or would like to volunteer your time as a contribution reviewer, please contact The Carpentries Team at [email protected].