pythongithubjupyter-notebookgoogle-colaboratory

How to make the output appear in github using jupyter notebook


I am using Github to create a portfolio. I wrote some code in Google Colab and uploaded it to Github. But I can't see the output. I'd like to see the output appear, so the person who sees my portfolio would understand what I have done.

Is there any way to show the output in github?

Colab: enter image description here

Github:

enter image description here


Solution

  • nbviewer

    nbviewer, provided by the Jupyter community, offers many types of rich output rendering and interactivity for previously run notebooks.

    nbviewer has several full-featured abilities GitHub doesn't and presents it in a nice way that's not overwhelming for those not as tech savvy as GitHub users. You can point it at any GitHub or gist, or even where the notebook code is online at a URL. The link to the view can be shared with others.

    I like to think of the Github notebook viewer as a quick preview.


    nbsanity

    Or if you are working more on a mobile devices or need more flexibility in rendering, you may be interested in a parallel tech at nbsanity.com. (Source code at https://github.com/hamelsmu/nbsanity .)

    "I WAS SO FRUSTRATED with the way @github renders Jupyter Notebooks, esp on mobile (You cannot horizontal scroll code, even with nbviewer). It's different than nbviewer because it uses @quarto_pub as the renderer, which has a more sane way of showing notebooks on different platforms.The upshot is, it will also respect all the quarto directives if that happens to be in your notebook" - Source: Hamel Husain (here and here)

    UPDATE:
    In regards to better control of output rendering:
    https://x.com/HamelHusain/status/1869609229944054187 December 2024

    "But why is nbsanity needed? There are already things like nbviewer, however we need to allow for the customization of output, so cell input/output can be hidden, collapsed, etc. We leverage the power of @quarto_pub (our fav SSG for notebooks) https://answer.ai/posts/2024-12-13-nbsanity.html#what-is-nbsanity "

    And justification for need given GitHub's rendering issues: https://x.com/HamelHusain/status/1869609196486017085 December 2024

    "The most annoying gap in AI infra is poor rendering of notebooks on GitHub. ... This is why we are excited to announce nbsanity ..."

    See here for additional newer information on nbsanity.