Unable to show the print output of my notebook

If your notebooks had the output saved in them then probably you could have used nbviewer to render the output and plots. For example, with your latest .ipynb file that would be https://nbviewer.org/github/winash12/vortdivinversion/blob/master/Vorticity_Divergence_Inversion.ipynb. You’ll note the URL follows a pattern. However, you can always go to the main nbviewer page and it will generate the link using the form.

Nbviewer is capable of displaying a lot more output types than the GitHub preview does. For example, Plotly plots display and remain active in nbviewer whereas they don’t render int he GitHub preview meant for developers, see here & bottom paragraph here for more details.

However, if you look into the actual code here for your latest example, you’ll see every input cell you have with code, has "outputs": []. This means there’s no saved output. After you run the notebook, save it with the cells run.

In addition to what spookster said, you may wish to read about using the MyBinder service and JupyterLite here. The perspective there was focused on drafting notebooks; however, it was also meant for running them.
However, the notebook you’ve supplied as an example is not a simple one and may not work there. “As a newbie”, you’d want to start with simpler examples. For example go here and click ‘launch binder’ and work on running that notebook that comes up and saving it run and then downloading it to your machine. And then put it on the internet and point nbviewer at it. Start in the shallow end when learning. Not something as complex as you bring up.

I actually did try to run it with MyBinder-served session and got to about four or five cells in before I ran into issues where the code and the environment were sympatico, presumably. See Jupyter Notebook Viewer where I put the step-by-step of getting that far in at the top and you can see a plot showing in the displayed output if you scrolll down to the output of the 5th input cell.

I should also point out that the one you bring up isn’t going to work on JupyterLite as it involves a lot of network access.

In the future, specify details. We cannot tell what you tried or didn’t try based on a vague statement that you tried all the solutions mentioned in StackOveflow. Please read Getting good answers to your questions. Pay particular attention to the admonition ’ Make sure to keep track of what you find when researching, even if it doesn’t help! If you ultimately aren’t able to find the answer to your question elsewhere on this site, then including links to related questions (as well as an explanation of why they didn’t help in your specific case) will help’, under the section ‘Search, and Research’, in the link to How do I ask a good question? at the bottom there.

1 Like