Spyder: Resize in dataframe viewer does not honor column name length

Created on 10 Aug 2019  路  4Comments  路  Source: spyder-ide/spyder

Problem Description

In Spyder 4.0.0beta3, when viewing pandas data frames in the variable explorer, I find that the "resize" functionality only honors the width of the actual contents of a column, not the column name. So if the column name is long, it will get clipped and not quite visible.

Interestingly, in all versions of Spyder 3, this is a non-issue: the display width of the column takes into account column name as well. (This is also the expected behavior in Microsoft Excel and/or Google Spreadsheet too.)

What steps reproduce the problem?

  1. Run the following codes:
import pandas as pd
df = pd.DataFrame({'col1': [1, 2, 3], 'column_with_a_long_name': [2, 3, 4]})
  1. Open df in the variable explorer, and click the "resize" button

What is the expected output? What do you see instead?

The second column's name ("column_with_a_long_name") should not be clipped.

Versions

  • Spyder version: Spyder 4.0.0beta4
  • Python version: 3.7.3
  • Qt version: 5.9.6
  • PyQt version: 5.9.2
  • Operating System name/version: Linux 4.15.10-55-generic
Variable Explorer Bug

All 4 comments

@dalthviz, please take a look at this one.

Hi @ccordoba12 , a somewhat unrelated question: Spyder 4 seems to be some kind of a rewrite parallel to Spyder 3. Is it true? I am just curious what you and your team's vision for these two versions is. Thanks!

In Spyder 4 we replaced a lot of things present in Spyder 3 (e.g. the entire code completion architecture used in our editor) and improved several other things (e.g. our dataframe viewer, to support multi-indexes).

So I wouldn't say Spyder 4 is a complete rewrite, it's just a new major version that adds a lot of new stuff. And due to those additions, things cannot be working as they used to in Spyder 3.

Thanks for the reply!

Was this page helpful?
0 / 5 - 0 ratings