-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
MultiIndex smart repr fmt doesn't work well for complex examples #3347
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
Comments
Why not have it repr as if it were the columns of a DataFrame? |
Interesting. Along with a couple of similar changes queued for 0.12 though, If that sort of view is wanted, it's not difficult to convert the multindex tuples |
@y-p Oh I meant as if it were the actual column index of a I've done that in the past with |
+1 for repr being valid and give back the output to recreate object.
I suppose the possible caveat could be if the index is very long (the
|
@jtratner didn't we have a recent issue related to multi-index formatting? can you link it here (and possibly close this one if a dupe) |
related to #3941 |
how about we just change the MultiIndex repr to just look like how it looks with columns? So if you have a Series with a MultiIndex like this:
then the MultiIndex repr should just be this (or maybe it's transpose?)
Way better. |
Can we have a str/unicode as @jtratner suggests, but a repr which is valid python to recreate itself? |
sure, but repr should just be this:
But probably wouldn't show the ones that are all None. |
oh how nice, we can already just use So if max rows were 10, it'd be:
Are we going to do something special for HTML? |
Got this working - yay!
And with too many rows:
|
Not sure how to handle too wide -- wrap? format() doesn't try to sparsify after a column with values everywhere.
|
And here's @y-p's more complicated thing:
|
I don't know what happened to this, whether the solution is unrelated to my problem, but my dataframe like this:
2 million characters is a lot to print... it would be really nice to have a shorter representation. |
@naught101 see #12423 |
hiding the repeated
foo
andbar
is nice for small multindices, butfor more levels and more complex structures, it can becomes
harder to read. The blanks also keep their width, and the result
isn't very attractive when presented as a single line:
The text was updated successfully, but these errors were encountered: