Skip to content

Commit f83c65c

Browse files
committed
changed default value of cache_dates var to true
1 parent 028b55d commit f83c65c

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,
@@ -1388,7 +1388,7 @@ def __init__(self, kwds):
13881388
self.tupleize_cols = kwds.get('tupleize_cols', False)
13891389
self.mangle_dupe_cols = kwds.get('mangle_dupe_cols', True)
13901390
self.infer_datetime_format = kwds.pop('infer_datetime_format', False)
1391-
self.cache_dates = kwds.pop('cache_dates', False)
1391+
self.cache_dates = kwds.pop('cache_dates', True)
13921392

13931393
self._date_conv = _make_date_converter(
13941394
date_parser=self.date_parser,
@@ -3184,7 +3184,7 @@ def _get_lines(self, rows=None):
31843184

31853185

31863186
def _make_date_converter(date_parser=None, dayfirst=False,
3187-
infer_datetime_format=False, cache_dates=False):
3187+
infer_datetime_format=False, cache_dates=True):
31883188
def converter(*date_cols):
31893189
if date_parser is None:
31903190
strs = _concat_date_cols(date_cols)

0 commit comments

Comments
 (0)