Skip to content

Commit 8caea7f

Browse files
committed
Fix isort, retain some comments
1 parent e208be9 commit 8caea7f

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

asv_bench/benchmarks/io/parsers.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import numpy as np
2+
13
from pandas._libs.tslibs.parsing import _does_string_look_like_datetime
4+
25
from pandas.io.parsers import _concat_date_cols
3-
import numpy as np
46

57

68
class DoesStringLookLikeDatetime(object):

pandas/_libs/tslibs/parsing.pyx

+2
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ cpdef bint _does_string_look_like_datetime(object date_string):
219219
if length >= 1:
220220
first = buf[0]
221221
if first == b'0':
222+
# Strings starting with 0 are more consistent with a
223+
# date-like string than a number
222224
return True
223225
elif date_string in _not_datelike_strings:
224226
return False

pandas/io/parsers.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
import numpy as np
1616

17-
from pandas._libs.lib import _concat_date_cols
1817
import pandas._libs.lib as lib
18+
from pandas._libs.lib import _concat_date_cols
1919
import pandas._libs.ops as libops
2020
import pandas._libs.parsers as parsers
2121
from pandas._libs.tslibs import parsing
@@ -3194,13 +3194,9 @@ def converter(*date_cols):
31943194
except Exception:
31953195
try:
31963196
return tools.to_datetime(
3197-
parsing.try_parse_dates(
3198-
_concat_date_cols(
3199-
date_cols,
3200-
keep_trivial_numbers=True
3201-
),
3202-
parser=date_parser,
3203-
dayfirst=dayfirst),
3197+
parsing.try_parse_dates(_concat_date_cols(date_cols),
3198+
parser=date_parser,
3199+
dayfirst=dayfirst),
32043200
errors='ignore')
32053201
except Exception:
32063202
return generic_parser(date_parser, *date_cols)

0 commit comments

Comments
 (0)