Skip to content

Commit 6690a33

Browse files
committed
changed default value of cache_dates var to true
1 parent a407c94 commit 6690a33

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pandas/io/parsers.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@
327327
values. The options are `None` for the ordinary converter,
328328
`high` for the high-precision converter, and `round_trip` for the
329329
round-trip converter.
330-
cache_dates : boolean, default False
330+
cache_dates : boolean, default True
331331
If True, use a cache of unique, converted dates to apply the datetime
332332
conversion. May produce significant speed-up when parsing duplicate
333333
date strings, especially ones with timezone offsets.
@@ -482,7 +482,7 @@ def _read(filepath_or_buffer: FilePathOrBuffer, kwds):
482482
'false_values': None,
483483
'converters': None,
484484
'dtype': None,
485-
'cache_dates': False,
485+
'cache_dates': True,
486486

487487
'thousands': None,
488488
'comment': None,
@@ -584,7 +584,7 @@ def parser_f(filepath_or_buffer: FilePathOrBuffer,
584584
keep_date_col=False,
585585
date_parser=None,
586586
dayfirst=False,
587-
cache_dates=False,
587+
cache_dates=True,
588588

589589
# Iteration
590590
iterator=False,
@@ -1394,7 +1394,7 @@ def __init__(self, kwds):
13941394
self.tupleize_cols = kwds.get('tupleize_cols', False)
13951395
self.mangle_dupe_cols = kwds.get('mangle_dupe_cols', True)
13961396
self.infer_datetime_format = kwds.pop('infer_datetime_format', False)
1397-
self.cache_dates = kwds.pop('cache_dates', False)
1397+
self.cache_dates = kwds.pop('cache_dates', True)
13981398

13991399
self._date_conv = _make_date_converter(
14001400
date_parser=self.date_parser,
@@ -3190,7 +3190,7 @@ def _get_lines(self, rows=None):
31903190

31913191

31923192
def _make_date_converter(date_parser=None, dayfirst=False,
3193-
infer_datetime_format=False, cache_dates=False):
3193+
infer_datetime_format=False, cache_dates=True):
31943194
def converter(*date_cols):
31953195
if date_parser is None:
31963196
strs = _concat_date_cols(date_cols)

0 commit comments

Comments
 (0)