Skip to content

Commit 76547e1

Browse files
committed
adjust imports, docs and move whatsnew
1 parent 82f36d3 commit 76547e1

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

doc/source/whatsnew/v0.21.1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Deprecations
3939
Performance Improvements
4040
~~~~~~~~~~~~~~~~~~~~~~~~
4141

42-
- Added a keyword argument, `cache`, to :func:`to_datetime` that improved the performance of converting duplicate datetime arguments (:issue: `11665`)
42+
-
4343
-
4444
-
4545

doc/source/whatsnew/v0.22.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Performance Improvements
7070
~~~~~~~~~~~~~~~~~~~~~~~~
7171

7272
- Indexers on ``Series`` or ``DataFrame`` no longer create a reference cycle (:issue:`17956`)
73-
-
73+
- Added a keyword argument, ``cache``, to :func:`to_datetime` that improved the performance of converting duplicate datetime arguments (:issue:`11665`)
7474
-
7575

7676
.. _whatsnew_0220.docs:

pandas/core/tools/datetimes.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,10 @@ def _maybe_cache(arg, format, cache, tz, _convert_listlike):
5353

5454
def _convert_and_box_cache(arg, cache_array, box, errors, tz, name=None):
5555
"""Convert array of dates with a cache and box the result"""
56-
from pandas import Series
57-
from pandas.core.indexes.datetimes import DatetimeIndex
56+
from pandas import Series, DatetimeIndex, Index
5857
result = Series(arg).map(cache_array)
5958
if box:
6059
if errors == 'ignore':
61-
from pandas import Index
6260
result = Index(result)
6361
else:
6462
result = DatetimeIndex(result, tz=tz, name=name)
@@ -142,11 +140,11 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
142140
143141
.. versionadded: 0.20.0
144142
cache : boolean, default False
145-
If False, use a cache of unique, converted dates to apply the datetime
143+
If True, use a cache of unique, converted dates to apply the datetime
146144
conversion. May produce sigificant speed-up when parsing duplicate date
147145
strings, especially ones with timezone offsets.
148146
149-
.. versionadded: 0.21.1
147+
.. versionadded: 0.22.0
150148
Returns
151149
-------
152150
ret : datetime if parsing succeeded.

0 commit comments

Comments
 (0)