-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
Use display() not print() to display a dataframe in a jupyter notebook! #342
Comments
Good idea - I always use display in this context. |
Making this change would weld us pretty firmly to the notebook as a teaching interface - I still don't introduce it until after the first coffee break because I find the cognitive load of a new kind of editing on top of learning a language is too much for some learners. |
This particular lesson is already welded to the notebook as a teaching interface, isn't it? |
I think a section introducing display() would be a good idea. It would be an especially good idea in the pandas section. I agree - the default printing of a pandas table is pretty ugly. I think wholesale elimination of the print function is a bad idea. Why? Display does not work (so far as I can tell) from the python command line. This seems like a big missed idea if a learner is going to go on to writing python programs that live and are executed in the shell. |
I think introducing
|
I would like to link issue #397 which proposes switching to JupyterLab from Jupyter notebook. Using JupyterLab instead of Jupyter notebook might help those instructors such as @gvwilson who teach Python from a console first and then introduce Jupyter notebooks later. Process of launching the Jupyter lab server is the same as launching the Jupyter notebook server.. $ jupyter lab ...instead of the following. $ jupyter notebook JupyterLab server UI is similar in many respects to RStudio UI. In particular, JupyterLab includes an IPython console/terminal as part of the UI which would help reduce the cognitive load for learners when switching between console and notebooks. |
For now, I think the easiest way to address this issue is to add a small discussion of display() in episode 8, which works with dataframes. Display would be especially relevant here because print doesn't render dataframes nicely. |
+1 |
1 similar comment
+1 |
Sounds fine.
…On Wed, Jun 5, 2019 at 5:43 AM Olav Vahtras ***@***.***> wrote:
+1
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#342?email_source=notifications&email_token=ACDYZOXLMGLSOGLGGJRIYCDPY6KD7A5CNFSM4GA44KSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW7KGYY#issuecomment-499032931>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACDYZOUNGHNXLTMOTG3E5TDPY6KD7ANCNFSM4GA44KSA>
.
--
- - - - - - - - - - - - - - - - - - - - -
Nathan Moore
Mississippi River and 44th Parallel
- - - - - - - - - - - - - - - - - - - - -
|
Actually, the discussion of |
Sure, it would be fine there as well.
…On Wed, Jun 5, 2019 at 12:24 PM Jeremy Zucker ***@***.***> wrote:
Actually, the discussion should be in episode 7, Reading Tabular Data
into DataFrames
<https://swcarpentry.github.io/python-novice-gapminder/07-reading-tabular/index.html>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#342?email_source=notifications&email_token=ACDYZOVJPSGATHPNFS2YSGDPY7ZGFA5CNFSM4GA44KSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXANUOY#issuecomment-499178043>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACDYZOQFHMZA45MTE4XXH6TPY7ZGFANCNFSM4GA44KSA>
.
--
- - - - - - - - - - - - - - - - - - - - -
Nathan Moore
Mississippi River and 44th Parallel
- - - - - - - - - - - - - - - - - - - - -
|
This solved my issue with having to separate cells in my notebook! Thanks so much |
What's the rationale of using Also, the only issue I can think of with replacing |
not working sir,still open new tab |
%matplotlib inline |
Hi folks,
I want to submit a pull request that removes all
print()
statements from the lesson, and at the very minimum, replaces them withdisplay()
. Jupyter notebooks by default display dataframes in an easy-to read html table, whereas the print function displays an ugly, hard-to-follow, poorly formatted ascii tab-separated output. If you want to view the value of the last line of a notebook cell, then you don't even needdisplay()
. Plus, once folks are familiar withfrom IPython.display import display
, then it is logical to mention additional display outputs such asImage()
,Latex()
andSVG
.Please let me know what the probability of accepting this pull request would be before I go ahead and do the work.
Sincerely,
Jeremy
The text was updated successfully, but these errors were encountered: