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

to_excel with engine='xlwt' doesn't support pandas.tslib.Timedelta #9155

Closed
scls19fr opened this Issue Dec 26, 2014 · 4 comments

Comments

Projects
None yet
4 participants
@scls19fr
Contributor

scls19fr commented Dec 26, 2014

Hello,

to_excel method with engine='xlwt' doesn't support pandas.tslib.Timedelta

import numpy as np
import pandas as pd

idx = pd.date_range('20140101', '20140201')
df = pd.DataFrame(index=idx)
df['col0'] = np.random.randn(len(idx))
s_idx = pd.Series(idx, index=idx)
diff_idx = (s_idx-s_idx.shift(1)).fillna(pd.Timedelta(0))
df['diff_dt'] = diff_idx
df.to_excel("out.xls", engine='xlwt')

it works fine with xlsx files (engine openpyxl or xlsxwriter).

Kind regards

@jreback

This comment has been minimized.

Contributor

jreback commented Dec 26, 2014

showing the versions is always helpful (pd.show_versions()).

@scls19fr

This comment has been minimized.

Contributor

scls19fr commented Dec 26, 2014

INSTALLED VERSIONS
------------------
commit: None
python: 2.7.6.final.0
python-bits: 64
OS: Darwin
OS-release: 14.0.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: fr_FR.UTF-8

pandas: 0.15.2
nose: 1.3.4
Cython: 0.21.1
numpy: 1.9.1
scipy: 0.14.1rc1
statsmodels: 0.6.1
IPython: 2.3.1
sphinx: 1.2.3
patsy: 0.3.0
dateutil: 2.3
pytz: 2014.9
bottleneck: None
tables: 3.1.1
numexpr: 2.4
matplotlib: 1.4.2
openpyxl: 2.0.3
xlrd: 0.9.3
xlwt: 0.7.5
xlsxwriter: 0.6.4
lxml: 3.4.1
bs4: 4.3.2
html5lib: 0.999
httplib2: 0.8
apiclient: None
rpy2: None
sqlalchemy: 0.9.8
pymysql: 0.6.2.None
psycopg2: None
@shoyer

This comment has been minimized.

Member

shoyer commented Jan 2, 2015

@scls19fr does this work with the plain datetime.timedelta type instead of pd.Timedelta? This might be another case where Timedelta does not quite conform to the timedelta API.

@alexbw

This comment has been minimized.

alexbw commented May 5, 2015

+1

@jreback jreback added this to the 0.23.0 milestone Jan 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment