File tree 3 files changed +9
-9
lines changed
3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change
1
+ import numpy as np
2
+
1
3
from pandas ._libs .tslibs .parsing import _does_string_look_like_datetime
4
+
2
5
from pandas .io .parsers import _concat_date_cols
3
- import numpy as np
4
6
5
7
6
8
class DoesStringLookLikeDatetime (object ):
Original file line number Diff line number Diff line change @@ -219,6 +219,8 @@ cpdef bint _does_string_look_like_datetime(object date_string):
219
219
if length >= 1 :
220
220
first = buf[0 ]
221
221
if first == b' 0' :
222
+ # Strings starting with 0 are more consistent with a
223
+ # date-like string than a number
222
224
return True
223
225
elif date_string in _not_datelike_strings:
224
226
return False
Original file line number Diff line number Diff line change 14
14
15
15
import numpy as np
16
16
17
- from pandas ._libs .lib import _concat_date_cols
18
17
import pandas ._libs .lib as lib
18
+ from pandas ._libs .lib import _concat_date_cols
19
19
import pandas ._libs .ops as libops
20
20
import pandas ._libs .parsers as parsers
21
21
from pandas ._libs .tslibs import parsing
@@ -3194,13 +3194,9 @@ def converter(*date_cols):
3194
3194
except Exception :
3195
3195
try :
3196
3196
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 ),
3204
3200
errors = 'ignore' )
3205
3201
except Exception :
3206
3202
return generic_parser (date_parser , * date_cols )
You can’t perform that action at this time.
0 commit comments