Skip to content

Strange behaviour of DataFrame html repr in qtconsole #7372

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

Don't know if this is related to the new changes in 0.14 in the display of Dataframes or to #7180. But I find the following behaviour with 0.14 in Spyders IPython qtconsole:

new picture 7

To reproduce:

df = pd.DataFrame(np.random.randn(2,20), columns=list('ABCDEFGHIJKLMNOPQRST'))
df['very_long_column_name'] = [1,2]
df['X'] = ['very_long_column_values', 'other_long_string']
  • This seems not a very usefull behaviour to me?
    Should it truncate on width rather than number of columns?
  • It is also not truncating (above dataframe has 22 columns, while default max_columns is 20 (and I checked the setting)), while it truncated correctly for the text repr.

Other strange thing, I saw this in the Spyder IPython console (which is an embedded qtconsole I think). However, when I tried this in a qtconsole, it gave me first the text repr instead of the html repr (although pd.options.display.notebook_html_repr was set to True), so I used HTML(df.to_html()) for the above picture (but the result is the same as in Spyder).

@bjonen

Metadata

Metadata

Assignees

No one assigned

    Labels

    Output-Formatting__repr__ of pandas objects, to_string

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions