Cell stacking on each other in Jupyter dashboard view - python

I'm new to the Jupyter notebook. When I am moving to the dashboard grid layout, all off my cells are stack upon each other without any option of moving them. In addition, I can't go back to regular notebook view without reentering the notebook.
I've tried to play with the settings without success. Then I switched all my code to just 2 simple headings and it is still happening. Couldn't find any answers on the web.
Anyone has an idea how to solve it?

Related

How to control result size when using jupyter on vsc and how to search for words in result

I'm currently using Jupytor Notebook on VSC. I found it very uncomfortable when very long result come out because I have to scroll down a long way to go the the next cell, like shown in the picture.
So I was wondering if there is a way to make the result like the original Jupyter Notebook, where they have a separate scroll for the result as shown below.
As an additional question, anyone know how to search for certain words in the result on VSC? ctrl+f only searches for words in the coding cells and not the result.
A work around for the scroll wheel if you don’t want to collapse the code is to add a print statement to the beginning and end of the code block as mentioned in Collapse Output in VS Code Jupyter Into Scrollable Window. I have not been at my computer to test this and this post is from a year ago, so I’m not sure if this solution is still working. EDIT: This solution is no longer working keep an eye on the linked issue for the resolution.
This was also brought up as an issue on GitHub and it was closed saying they have no plans to work on it currently.
#118117
As for the searching in outputs, this is an open issue currently on GitHub: #94239
Scrollable output regions would be handled in VS Code core. This function has not been decided on GitHub at present
For your additional question, I think the filter feature in the search widget might be what you're looking for - you can include outputs with that.

Figure is not properly displayed whiile using %matplotlib notebook in Jupyter Notebook

As you can see on the image posted below, for some reason the notebook doesn't want to properly display a figure while using the interactive matplotlib interface - the %matplotlib notebook and it only prints the top left corner of the wanted plot. I've browsed the Internet, mostly this forum but I haven't found solution either, so I've got no other choice than to make a post about it.
If I switch it back to classic %matplotlib inline, I've got no issues and the figure is displayed correctly. I'd really appreciate any help you can offer, it drives me crazy because I need to properly display these interactive plots, in order to learn from other notebooks which use them. So I'm not searching for any other alternatives to using interactive figures, but I'd preferably want this particular issue to be resolved.
Thank you.
This was rather a quick solution to my suprise. I was even thinking of pulling this question off the site, since I resolved this quite promptly, but then again you never know, someone might end up with the very same problem as I encountered before.
So anyway, changing the browser does the trick. At least in my case changing from Chrome to Firefox solved this issue of mine.

How to show number of indents with little arrows in Jupyter Notebook?

I remember that I saw some code from the web that has little arrows in front of each line to identify its number of indents, which turned out to be very helpful when the code is long. But I can't find that web page anymore so I wonder if anyone knows how to add that kind of indicator in Jupyter Notebook? Thanks!

Messaging and Jupyter Notebooks

I'm trying to wrap my head around messaging in Jupyter notebooks. But I'm a bit lost and confused.
My goal is fairly straight forward to state: I want my python kernel to update the output of a cell in a Jupyter notebook while a long calculation is running. Whenever new data arrives in the browser, I want to trigger a redraw by calling some javascript function.
Specifically, the cell output contains HTML with a WebGL canvas. That part works well. I can easily visualize the initial data in the canvas with WebGL/javascript. But I want to update the data dynamically, as the kernel performs a long calculation on it. What I'd like to know is how one of my javascript functions in a notebook can receive binary data from my kernel.
I tried to read the documentation on messaging and jupyter notebooks, but it's really short and doesn't provide any links for further reading. What would really help is an example in the form of two code snippets, one for the notebook and the other for the kernel side.

Bokeh plots distorting nbviewer slides view

When using the web based iPython Notebook/Jupyter capability, i created a notebook with markdown cells of text and code cells to display the code and plots for matplotlib and bokeh. I then download that as .ipynb open with sublime, copy and paste to git, then access it on nbviewer through my git account. When looking at it here:
http://nbviewer.ipython.org/github/angisgrate/test/blob/master/pyohio3.ipynb
in notebook view, it works fine. the markdown, code, and plot steps are all there.
When switching to slides view, the intent of the creation needed for the presentation, this code blocks occurs first, blocking out the first 10 markdown steps and all the matplotlib steps, rendering this weird code without the plots:
http://nbviewer.ipython.org/format/slides/github/angisgrate/test/blob/master/pyohio3.ipynb
How can i fix this asap?? I've looked through and there was a similar problem in 2014 with slides, but it yielded an actual "Error" that i'm not seeing, just this contorted view
I can't say for certain. It's possible in the nbviewer slides view, the execution of JavaScript is suppressed (this happens on GitHub notebook previews, for instance). All of the rendering in Bokeh actually happens from the JavaScript library BokehJS, so if this is the case, then Bokeh will not function, and there is nothing really that can be done. This is probably a question bset directed towards the nbviewer team/community to find out the specifics of how the slides view behaves (and is intended to behave) with respect to executing embedded JavaScript.
Edit: Looks like this is a known/discussed issue. More information here: Issue #484: Jupyter>>nbviewer slides Fail, notebook view fine by angisgrate in jupyter/nbviewer on GitHub

Categories