Skip to content

set_option('max_colwidth', N) not working on groupby output #7856

Closed
@brifordwylie

Description

@brifordwylie

Hi All,

Might be pilot error (or the incorrect expectations), but I was expecting the max_colwidth option to work on groupby terminal output. Replication here:

$ python
> import pandas as pd
> df = pd.DataFrame([{'a':'foo','b':'bar','c':'uncomfortably long line with lots of stuff','d':1},  \
                                   {'a':'foo','b':'bar','c':'stuff', 'd':1}])
> df
     a    b                                           c  d
0  foo  bar  uncomfortably long line with lots of stuff  1
1  foo  bar                                       stuff  1

> pd.set_option('max_colwidth', 20)
> df
     a    b                    c  d
0  foo  bar  uncomfortably lo...  1
1  foo  bar                stuff  1

> group_df = df.groupby(['a','b','c']).sum()
> group_df
                                                    d
a   b   c                                            
foo bar stuff                                       1
        uncomfortably long line with lots of stuff  1
>>> 
>>> pd.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 2.7.6.final.0
python-bits: 64
OS: Darwin
OS-release: 13.3.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

pandas: 0.14.1
nose: None
Cython: 0.20.2
numpy: 1.8.1
scipy: None
statsmodels: None
IPython: 2.1.0
sphinx: 1.2.2
patsy: None
scikits.timeseries: None
dateutil: 2.2
pytz: 2014.4
bottleneck: None
tables: None
numexpr: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
rpy2: None
sqlalchemy: None
pymysql: None
psycopg2: None
>>> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions