How to avoid output into scrollable frames in jupyter notebook?

21,872

Solution 1

To disable auto-scrolling, execute this javascript in a notebook cell before other cells are executed:

%%javascript
IPython.OutputArea.prototype._should_scroll = function(lines) {
    return false;
}

There is also a jupyter notebook extension, autoscroll, you can use for a nicer UI.

Solution 2

You can just use mouse to click on the outside of the output Frame to toggle between scrolling, it worked for me. More precisely, you have to click the square to the left of your output (see image). Where to click exactly

Single click will toggle scroll mode, double click will hide output completely.

Solution 3

I stumbled across the same problem, a scrollbar appeared for outputs out of nowhere.

Just go to- Cell > All Outputs > Toggle Scrolling (On the Menu Bar) and outputs will go back to no scrolling.

Share:
21,872

Related videos on Youtube

Dims
Author by

Dims

Software developer & Machine Learning engineer C/C++/Java/C#/Python/Mathematica/MATLAB/Kotlin/R/PHP/JavaScript/SQL/HTML/ LinkedIn: http://www.linkedin.com/in/dimskraft Telegram: https://t.me/dims12 I prefer fishing rod over fish.

Updated on May 28, 2021

Comments

  • Dims
    Dims almost 3 years

    Suddenly, output for statements started to appear inside scrollable frames.

    I was playing with only one parameter

    pd.options.display.max_rows = 1000
    

    but after experiments, I commented this line out and restarted the kernel.

    Nevertheless, one of my outputs appears inside frame.

    How to avoid this?

    • Nickil Maveli
      Nickil Maveli over 7 years
      Does resetting this to default by pd.reset_option("display.max_rows") help?
    • Dims
      Dims over 7 years
      How can this affect if I restarted kernel?
    • Dims
      Dims over 7 years
      No it didn't help.
    • Randy
      Randy over 7 years
      pd.options.displays.max_rows just controls when pandas truncates output with a .... Scrollable frames are a part of Jupyter when the output for a given cell is long.
  • Jianyu
    Jianyu about 4 years
    Is there a way to ENABLE auto-scrolling again after disabling using this javascript?
  • mtd
    mtd almost 4 years
    @Jianyu to ENABLE, you could just change return false to return true
  • Peter Moore
    Peter Moore almost 4 years
    This also worked for me. Its not obvious. Clicking on the out sidebar toggles the scrollbar for that frame.
  • U2647
    U2647 over 3 years
    This is a very smart solution! You don't need to change any settings of Notebook!