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

ENH: Change truncation ellispsis to unicode character #7167

Closed
wants to merge 1 commit into from

Conversation

bjonen
Copy link
Contributor

@bjonen bjonen commented May 18, 2014

Changes the truncation symbol from '...' to the math characters horizontal, vertical and diagnol ellipsis as proposed in #7086 (comment).

In the Ipython Notebook, the result looks like this

http://nbviewer.ipython.org/gist/bjonen/492fea9559fd73edf579

To do:

@jreback jreback added this to the 0.14.1 milestone May 19, 2014
@bjonen
Copy link
Contributor Author

bjonen commented May 21, 2014

I believe #7174 is fixed. Shall I try to apply the changes to the current master or should we try to merge this enhanced version?

http://nbviewer.ipython.org/gist/bjonen/27aaf7d0981c8c1b4d84

@jreback
Copy link
Contributor

jreback commented May 21, 2014

hmm

I suppose if we merge the enhanced version then we should cut a rc2 (no big deal to do it).

@cpcloud @jorisvandenbossche ?

@cpcloud
Copy link
Member

cpcloud commented May 22, 2014

i think we should merge the fix for #7174 then cut the rc

@cpcloud
Copy link
Member

cpcloud commented May 22, 2014

and leave this for 14.1

@jreback
Copy link
Contributor

jreback commented May 22, 2014

@bjonen can you split out that fix into a separate PR?

@bjonen
Copy link
Contributor Author

bjonen commented May 22, 2014

Sure will do.

@cpcloud
Copy link
Member

cpcloud commented May 22, 2014

@bjonen can you show df.T in the notebook example? thx

@bjonen
Copy link
Contributor Author

bjonen commented May 22, 2014

You are right. Row multiindex needs fixing also.

The column fix was easy to extract. I'll submit a PR when the rows are done.

@cpcloud
Copy link
Member

cpcloud commented May 22, 2014

awesome column fix looks good!

@bjonen
Copy link
Contributor Author

bjonen commented May 30, 2014

Rebased with current master and updated notebook (see top).

from pandas.tools.merge import concat

self.horiz_ellips = u('\u22ef') # ⋯
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my comment below, make these package level globals

@jreback
Copy link
Contributor

jreback commented May 30, 2014

add an example in v0.14.1.txt (this is now going to be only place, no more release notes)

@jreback
Copy link
Contributor

jreback commented Jun 3, 2014

@bjonen whenever you can address my comments....like to get this in early this cycle

@bjonen
Copy link
Contributor Author

bjonen commented Jun 4, 2014

@jreback Sure, changed the location of the ellipsis. Example is still missing. I'm dealing with a problem in the console at the moment.

While the unicode characters seem to work well in the notebook, I'm having a bit of trouble in the console representation. It seems the unicode characters are not aligning properly. I'll look into this as soon as I have the time.

@bjonen
Copy link
Contributor Author

bjonen commented Jun 19, 2014

I'm having trouble to align the unicode characters well in the console. I'm not sure it might be that they do not take exactly one character length.

I can post an example case on the weekend. If this should go in the next release we could just keep it for html for now.

@jreback jreback modified the milestones: 0.15.0, 0.14.1 Jun 19, 2014
@bjonen
Copy link
Contributor Author

bjonen commented Jun 20, 2014

Here is a small before and after for a dataframe with the unicode character in the terminal.
0,14
before
After
after
The vertical ellipsis is shifted to the right of the above character which looks weird. Unless somebody has an idea how to fix this, perhaps we just have the unicode characters for the notebook and stick to the old representation for the terminal.

What do you think?

@jreback
Copy link
Contributor

jreback commented Jun 21, 2014

my 2c. I think that using horizontal dots for both vertical/horizonatl sep is fine. the only enhancement that I think I saw was the using the diagonal dots are cool, but these are unicode so have to be restricted to terminals? (or just html?)

@cpcloud
Copy link
Member

cpcloud commented Jun 25, 2014

i think using horizontal dots crowds the display unnecessarily.

@bjonen the vert ellipsis is slightly aligned to the right with certain fonts on certain terminals which personally i think is not a problem, and i would say is certainly better than ... right or even center aligned.

In [8]: print('1\n⋮\n2')
1
⋮
2

on github it shows up where you'd think.

i suggested the , , and because that's what the Julia folks use to display arrays and i think it looks really nice. they've been fairly successful in using this and i think it's a nice way to slightly modernize the look and feel of DataFrames.

What about having an (experimental?) option (default off) that allows one to use unicode ellipsis characters

something like

pd.options.display.unicode_ellipsis = True

@bjonen
Copy link
Contributor Author

bjonen commented Jun 27, 2014

I agree that unicode ellipsis are prettier. However, I find the slight right-alignment in the Ubuntu terminal quite confusing. Making this optional for now sounds good to me.

@jreback
Copy link
Contributor

jreback commented Jan 18, 2015

closing for now. I think the display is good ATM.

@jreback jreback closed this Jan 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants