Skip to content

Commit 2b3efa4

Browse files
BUG: wrong parsing of microseconds with format arg (pandas-dev#4152)
1 parent 13e18c9 commit 2b3efa4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pandas/tslib.pyx

+2-3
Original file line numberDiff line numberDiff line change
@@ -1049,8 +1049,7 @@ def array_strptime(ndarray[object] values, object fmt):
10491049
Py_ssize_t i, n = len(values)
10501050
pandas_datetimestruct dts
10511051
ndarray[int64_t] iresult
1052-
int year, month, day, minute, hour, second, weekday, julian
1053-
float64_t fraction
1052+
int year, month, day, minute, hour, second, fraction, weekday, julian
10541053

10551054
global _TimeRE_cache, _regex_cache
10561055
with _cache_lock:
@@ -1247,7 +1246,7 @@ def array_strptime(ndarray[object] values, object fmt):
12471246
dts.hour = hour
12481247
dts.min = minute
12491248
dts.sec = second
1250-
dts.us = int(fraction * 1000000)
1249+
dts.us = fraction
12511250

12521251
iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts)
12531252
_check_dts_bounds(iresult[i], &dts)

0 commit comments

Comments
 (0)