Closed
Description
Printing a pandas.DataFrame
in IPython's qtconsole tries to use _repr_html_
. This method returns None
if the terminal window that started the IPython session is too small.
I'm not sure this behaviour is right. When you're in the qtconsole, _repr_html_
should check the size of the qtconsole window and not the the size of the terminal that started the session.
Here are some steps to reproduce the issue:
- Create a very small terminal window and run
ipython qtconsole
. - Create a
pandas.DataFrame
calleddf
. - Run
df.head()
in IPython. You should notice that the HTML representation of the table is not used. - Maximize the small terminal window from step 1.
- Run
df.head()
in IPython. The HTML representation is now used.
I would guess the easiest way to fix this would be to add a qtconsole "os" in get_terminal_size
in util/terminal.py
and use Qt hooks to figure out the dimensions of the qtconsole.