-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Fastpath for to_datetime when providing ISO format as keyword? #8154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
if u provide a format I think it bypasses the infer_datetime_format option which is much faster if it knows the format so need to short circuit on certain formats |
But the
But indeed, the fact that it is faster with |
exactly I think needs a simple check if format is provided if we can fastpath it (eg for recognized formats), if so then just follow the infer_datetime_format=True path and ignore the format); I think this is done for YYYYMMDD (only) atm |
or in the basic format whee we don't need to infer at all just pass it thru (eg your first timeit with the 3rd format) |
With |
@jorisvandenbossche, fyi this is also closed by PR #10615 |
thanks |
Say you have to parse some nicely ISO formatted date strings, you can just parse this with
todatetime
very fast. But if you were 'overcautious' and provided theformat="%Y-%m-%d %H:%M:%S"
for safety, this seems to be around 20 times slower.Would it be possible to provide a fastpath for certain provided format strings (as already exists for
%Y%m%d
I think).For non-standard formats, providing format does give a big improvement:
The text was updated successfully, but these errors were encountered: