-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
API DesignDatetimeDatetime data dtypeDatetime data dtypePerformanceMemory or execution speed performanceMemory or execution speed performanceStringsString extension data type and string dataString extension data type and string data
Milestone
Description
Clearly the default is complete=True
for back-compat
but allows for a match starting at the beginning (has always been like this),
but doesn't require the string to ONLY match the format, IOW, can be extra stuff after the match.
Avoids having to do a regex replace first.
In [21]: s = Series(['19MAY11','19MAY11:00:00:00']*100000)
In [22]: %timeit pd.to_datetime(s.str.replace(':\S+$',''),format='%d%b%y')
1 loops, best of 3: 828 ms per loop
In [23]: %timeit pd.to_datetime(s,format='%d%b%y',compete=False)
1 loops, best of 3: 603 ms per loop
Metadata
Metadata
Assignees
Labels
API DesignDatetimeDatetime data dtypeDatetime data dtypePerformanceMemory or execution speed performanceMemory or execution speed performanceStringsString extension data type and string dataString extension data type and string data