-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ERR: raise on mutli-index columns as its not implemented in to_excel #9794
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
this is not implemented for a column multi-index, see #4679 So, going to change this issue to one for error reporting to raise until this is implemented. |
I'm starting on this one now |
ENH: Raise error writing excel file with a MultiIndexed DataFrame #9794
Hi guys, i'm just asking about when pandas will support exporting excel with multiindex column dataframe? is it already included for the next sprint? |
@dyngts This hasn't been implemented yet and I don't think it's on anyone's immediate agenda -- pandas is all volunteers. But we're certainly open to pull requests if you're interested in making a contribution. |
Just ran into this after upgrading to v0.16.1 from v0.15.2. I have a bunch of multi-indexed df's being written to Excel in some analyses I'm doing, as far as I know they've all been working fine in v0.15.2. The misalignment described here only seems to happen when you set |
OK, I've just hacked my v0.16.1 install so that it raises |
@onesandzeroes these are not readable back in, correct? (as we don't support reading the multi-line headers ATM). So this is pretty hard to tests. That said, I suppose if |
Would someone mind explaining why 0.15.2 was able to handle this but 0.16.x can't yet? This is my first time trying to look under the hood at how pandas does what it does. I think I understand what the error is, but I think I would understand so much more if I could explain why it was a non-issue before. |
Can we have @onesandzeroes solution? I've done the same, but I can't do this on my production machines. |
issue at #10564 though I think we need a argument to allow (so it can be turned on/off) |
+1 would be useful to have. |
Try to the following code, and you will find column labels mismatched with the data in the Excel file :
cols = pd.MultiIndex.from_tuples([('site',''),('2014','height'),('2014','weight')])
df = pd.DataFrame(np.random.randn(10,3), columns=cols)
df.to_excel('test.xlsx', index=False)
I am using pandas v0.16.0.
The text was updated successfully, but these errors were encountered: