Skip to content

BUG: max_colwidth controls data, not headers #7059

Closed
@jreback

Description

@jreback

statsmodels/statsmodels#1584

So should do something with the headers (maybe do a '....')

In [2]: df = DataFrame(1,index=range(2),columns=['short','really long'])

In [3]: df
Out[3]: 
   short  really long
0      1            1
1      1            1

[2 rows x 2 columns]

In [6]: with pd.option_context('display.max_colwidth',5):
   ...:     print(df)
   ...:     
   short  really long
0     1      1       
1     1      1       

[2 rows x 2 columns]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions