Skip to content

Commit

Permalink
Merge pull request #3148 from jreback/timedelta_170
Browse files Browse the repository at this point in the history
BUG: GH3094, timedelta64 failing on numpy 1.7.0 (on 2.7)
  • Loading branch information
jreback committed Mar 23, 2013
2 parents 70974fb + 29fe395 commit 7a1e61a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion RELEASE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ pandas 0.11.0
- Series ops with a Timestamp on the rhs was throwing an exception (GH2898_)
added tests for Series ops with datetimes,timedeltas,Timestamps, and datelike
Series on both lhs and rhs
- Fixed subtle timedelta64 inference issue on py3
- Fixed subtle timedelta64 inference issue on py3 & numpy 1.7.0 (GH3094_)
- Fixed some formatting issues on timedelta when negative
- Support null checking on timedelta64, representing (and formatting) with NaT
- Support setitem with np.nan value, converts to NaT
Expand Down Expand Up @@ -293,6 +293,7 @@ pandas 0.11.0
.. _GH3115: https://github.com/pydata/pandas/issues/3115
.. _GH3070: https://github.com/pydata/pandas/issues/3070
.. _GH3075: https://github.com/pydata/pandas/issues/3075
.. _GH3094: https://github.com/pydata/pandas/issues/3094
.. _GH3130: https://github.com/pydata/pandas/issues/3130

pandas 0.10.1
Expand Down
5 changes: 5 additions & 0 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ def convert_to_array(values):
pass
else:
values = com._possibly_cast_to_timedelta(values)
elif inferred_type in set(['integer']):
if values.dtype == 'timedelta64[ns]':
pass
elif values.dtype.kind == 'm':
values = values.astype('timedelta64[ns]')
else:
values = pa.array(values)
return values
Expand Down

0 comments on commit 7a1e61a

Please sign in to comment.