Skip to content

io: to_excel leads to TypeError when index with tz #11961

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

Closed
dacoex opened this issue Jan 5, 2016 · 2 comments
Closed

io: to_excel leads to TypeError when index with tz #11961

dacoex opened this issue Jan 5, 2016 · 2 comments
Labels
Duplicate Report Duplicate issue or pull request IO Excel read_excel, to_excel Timezones Timezone data dtype

Comments

@dacoex
Copy link
Contributor

dacoex commented Jan 5, 2016

I would like to save a df with the following index to an Excel file:


it shows the following error:


TypeError: Timestamp subtraction must have the same timezones or no timezones

@jorisvandenbossche
Copy link
Member

@dacoex Thanks for the report!
I suppose this is a duplicate of #7056

This is not really implemented at the moment (excel also does not support timezones, so an implementation would something be like a removal of the timezone + warning).
For now, you can convert it to naive timestamps yourself before exporting to excel.

@jorisvandenbossche jorisvandenbossche added Duplicate Report Duplicate issue or pull request IO Excel read_excel, to_excel Timezones Timezone data dtype labels Jan 5, 2016
@jorisvandenbossche jorisvandenbossche added this to the No action milestone Jan 5, 2016
@dacoex
Copy link
Contributor Author

dacoex commented Jan 5, 2016

Just as reference for anyone:
use

df.tz_localize(None)

http://pandas-docs.github.io/pandas-docs-travis/timeseries.html#time-zone-handling

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 IO Excel read_excel, to_excel Timezones Timezone data dtype
Projects
None yet
Development

No branches or pull requests

2 participants