A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/10231 below:

Undesired UX behavior of DataFrame output in IPython Notebook · Issue #10231 · pandas-dev/pandas · GitHub

From my previous line comment at be80898#commitcomment-11338872. cc @takluyver @jorisvandenbossche

Because DataFrame's _repr_html_ returns hardcoded div tag with style max-height:1000px, if the height of DataFrame's output exceeds 1000px, it will generate a scroll bar.

First, it is unnecessary because IPython Notebook has "toggle output scrolling" feature. Second, it causes UX problem if the height of browser resolution is below 1000px (user must scroll twice: the whole page and the generated div). Third, it can't make use of "toggle output scrolling" feature (if user turn it on, it will generate nested scroll bars (worse UX)). For more detailed explanations and examples, see the steps to reproduce below.

Pandas version: 0.16.1.

Steps to reproduce:

  1. Open an IPython Notebook and paste this code. It will generate an inner scroll bar because the output's height exceeds 1000px.

    import pandas as pd
    pd.DataFrame(list(range(100)))
  2. If you want to see all rows, first you should scroll the page.

  3. After you reach the bottom of the generated ouput's div, you should scroll again the inner scroll bar.

  4. If you want to toggle the IPython Notebook's "toggle output scrolling" feature, you get this.

Desired behaviors:

Solution:
Remove style property from div tag that DataFrame's _repr_html_ returns.
Old: <div style="max-height:1000px;max-width:1500px;overflow:auto;">\n
New: <div>\n

Why should max-width be removed as well? Because it also generates far worse UX. If you have so many columns that the horizontal scroll bar generated, you cannot scroll it. You must refresh the page to be able to scroll it.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4