10

I've just upgraded to Canopy 1.7.1; I think this problem stems from the change in IPython version from 2.4.1 to 4.1.2.

The issue I have is that calling a DataFrame object in Python seems to use the __print__ method, i.e. there's no difference between typing print df and df into the interpreter, and unfortunately this gives me an all-text output rather than the nice tables I normally get.

So I get something that looks exactly like this when I call df rather than a table:

           date  flag
1      20151102     0
98663  20151101     1

This happened immediately after the upgrade, and I also tried updating all my packages. I've also looked at this and this, but none of the solutions there work for me. ('display.notebook_repr_html' is already True)

EDIT: The issue seems to do with rendering HTML; typing in

from IPython.core.display import display, HTML
display(HTML('<h1>Hello, world!</h1>'))

returns

<IPython.core.display.HTML object>
Community
  • 1
  • 1
Ken Wei
  • 3,020
  • 1
  • 10
  • 30
  • 2
    I think you are correct that this relates to the change in IPython (I am seeing the same behavior with conda, so I don't think it is a Canopy-specific issue). The referenced suggestions work for Jupyter notebooks, but not at the IPython prompt. Possibly a bug in IPython? One thing you can try is using `view(df)` from Enthought's new catalyst package (`from catalyst.api import view`). This will open a dataframe viewer which is part of the new Data Import Tool (available to subscribers). The dataframe viewer itself is available to all users. – J. Corson May 05 '16 at 14:56
  • 1
    Thank you, the DataFrame viewer works and is definitely useful, though I would still like to see the table being rendered properly in the interpreter output (but it does seem more like it's an issue with IPython beyond my control)! – Ken Wei May 06 '16 at 04:21

1 Answers1

1

This has purposely been disabled. I have requested a way to have it re-enabled but but unsupported.

Please see the request. https://github.com/jupyter/qtconsole/issues/165

Keith
  • 4,646
  • 7
  • 43
  • 72