Skip to content

Commit 7a1e61a

Browse files
committed
Merge pull request #3148 from jreback/timedelta_170
BUG: GH3094, timedelta64 failing on numpy 1.7.0 (on 2.7)
2 parents 70974fb + 29fe395 commit 7a1e61a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

RELEASE.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ pandas 0.11.0
179179
- Series ops with a Timestamp on the rhs was throwing an exception (GH2898_)
180180
added tests for Series ops with datetimes,timedeltas,Timestamps, and datelike
181181
Series on both lhs and rhs
182-
- Fixed subtle timedelta64 inference issue on py3
182+
- Fixed subtle timedelta64 inference issue on py3 & numpy 1.7.0 (GH3094_)
183183
- Fixed some formatting issues on timedelta when negative
184184
- Support null checking on timedelta64, representing (and formatting) with NaT
185185
- Support setitem with np.nan value, converts to NaT
@@ -293,6 +293,7 @@ pandas 0.11.0
293293
.. _GH3115: https://github.com/pydata/pandas/issues/3115
294294
.. _GH3070: https://github.com/pydata/pandas/issues/3070
295295
.. _GH3075: https://github.com/pydata/pandas/issues/3075
296+
.. _GH3094: https://github.com/pydata/pandas/issues/3094
296297
.. _GH3130: https://github.com/pydata/pandas/issues/3130
297298

298299
pandas 0.10.1

pandas/core/series.py

+5
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ def convert_to_array(values):
104104
pass
105105
else:
106106
values = com._possibly_cast_to_timedelta(values)
107+
elif inferred_type in set(['integer']):
108+
if values.dtype == 'timedelta64[ns]':
109+
pass
110+
elif values.dtype.kind == 'm':
111+
values = values.astype('timedelta64[ns]')
107112
else:
108113
values = pa.array(values)
109114
return values

0 commit comments

Comments
 (0)