File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 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
159159- ``StataWriter `` and ``DataFrame.to_stata `` accept time stamp and data labels (:issue: `6545 `)
160160- offset/freq info now in Timestamp __repr__ (:issue: `4553 `)
161161- Support passing ``encoding `` with xlwt (:issue: `3710 `)
162+ - Performance improvement when converting ``DatetimeIndex `` to floating ordinals
163+ using ``DatetimeConverter `` (:issue: `6636 `)
162164
163165.. _release.bug_fixes-0.14.0 :
164166
Original file line number Diff line number Diff line change 1616import pandas .core .common as com
1717from pandas .core .index import Index
1818
19+ from pandas import Series
1920from pandas .tseries .index import date_range
2021import pandas .tseries .tools as tools
2122import pandas .tseries .frequencies as frequencies
@@ -144,8 +145,8 @@ def _dt_to_float_ordinal(dt):
144145 preserving hours, minutes, seconds and microseconds. Return value
145146 is a :func:`float`.
146147 """
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 )
149150 else :
150151 base = dates .date2num (dt )
151152 return base
You can’t perform that action at this time.
0 commit comments