File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,8 @@ Improvements to existing features
159
159
- ``StataWriter `` and ``DataFrame.to_stata `` accept time stamp and data labels (:issue: `6545 `)
160
160
- offset/freq info now in Timestamp __repr__ (:issue: `4553 `)
161
161
- Support passing ``encoding `` with xlwt (:issue: `3710 `)
162
+ - Performance improvement when converting ``DatetimeIndex `` to floating ordinals
163
+ using ``DatetimeConverter `` (:issue: `6636 `)
162
164
163
165
.. _release.bug_fixes-0.14.0 :
164
166
Original file line number Diff line number Diff line change 16
16
import pandas .core .common as com
17
17
from pandas .core .index import Index
18
18
19
+ from pandas import Series
19
20
from pandas .tseries .index import date_range
20
21
import pandas .tseries .tools as tools
21
22
import pandas .tseries .frequencies as frequencies
@@ -144,8 +145,8 @@ def _dt_to_float_ordinal(dt):
144
145
preserving hours, minutes, seconds and microseconds. Return value
145
146
is a :func:`float`.
146
147
"""
147
- if isinstance (dt , np .ndarray ) and com .is_datetime64_ns_dtype (dt ):
148
- base = dates .epoch2num (dt .astype ( np . int64 ) / 1.0E9 )
148
+ if isinstance (dt , ( np .ndarray , Series ) ) and com .is_datetime64_ns_dtype (dt ):
149
+ base = dates .epoch2num (dt .asi8 / 1.0E9 )
149
150
else :
150
151
base = dates .date2num (dt )
151
152
return base
You can’t perform that action at this time.
0 commit comments