Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce 'tidy_repr' for DataFrames #6938

Closed
bjonen opened this issue Apr 23, 2014 · 1 comment
Closed

Introduce 'tidy_repr' for DataFrames #6938

bjonen opened this issue Apr 23, 2014 · 1 comment
Labels
Duplicate Report Duplicate issue or pull request Output-Formatting __repr__ of pandas objects, to_string

Comments

@bjonen
Copy link
Contributor

bjonen commented Apr 23, 2014

How about adding a tidy_repr similar to the one available for Series (https://github.com/pydata/pandas/blob/master/pandas/core/series.py#L845) to the possible ways of displaying a DataFrame. I find this view very convenient for displaying long series. Searching through past issues I couldn't find a discussion on why this representation is not used for DataFrames.

I know the default view has recently changed to truncate (#4886). What I find missing with the truncate view is the possibility to see where the index/columns end. However, I know this is a very subjective topic, so I'd simply like to propose to add this view as an option.

The code for the representation could look similar to this (ignoring the column representation for the moment).
...

df = pd.DataFrame(columns=['a','b','c'],
       index=pd.DatetimeIndex(start='19900101',end='20000101',freq='BM'))

print df.iloc[:10].__repr__() + '\n...\n' + df.iloc[-10:].__repr__()

...

This proposal is related to #6890.

@jreback
Copy link
Contributor

jreback commented Apr 23, 2014

see #5603

which I would very much like to see in 0.14

it's pretty straightforward extension of truncate

pls submit a PR

going to mark-close this as a dupe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

No branches or pull requests

2 participants