-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Infer best datetime format from a sample #52626
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
Closed
Closed
Changes from 33 commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
fd7a534
All tests pass
LeoGrin 93f9c7a
Update changelog
LeoGrin c37d40f
Add missing type hints
LeoGrin cbb5e0d
Cleaning
LeoGrin 81664a2
Typo
LeoGrin ef33ba0
comment change
LeoGrin e1652f1
simplification
LeoGrin 6b371ca
remove randomness
LeoGrin 705d1b4
fix parser tests
LeoGrin 27e39f3
Merge branch 'main' into datetime_format_inference_test
LeoGrin 0bae15d
simplify getting evenly spaced non null
LeoGrin de7331f
update io readme
LeoGrin 9136b4f
revert changed tests
LeoGrin 9f966d5
fix type hints
LeoGrin be9e27a
Merge branch 'main' of https://github.com/pandas-dev/pandas into date…
LeoGrin e5e3cb3
Merge branch 'datetime_format_inference_test' of https://github.com/L…
LeoGrin 7ca7244
fix type hints for np.unique
LeoGrin 4b81192
remove prints
LeoGrin 001a270
fix doc
LeoGrin fe99f83
fix example with febuary 30th
LeoGrin 1d5b6d1
Merge branch 'main' into datetime_format_inference_test
LeoGrin 8de90e4
fix doc
LeoGrin 0b5ec7d
Merge branch 'datetime_format_inference_test' of https://github.com/L…
LeoGrin 544aade
Merge branch 'main' into datetime_format_inference_test
LeoGrin a236ba9
Merge branch 'main' into datetime_format_inference_test
LeoGrin 40ac264
Merge branch 'main' into datetime_format_inference_test
LeoGrin 4cc9b0e
Merge branch 'main' into datetime_format_inference_test
LeoGrin 0b4d46e
Merge branch 'main' into datetime_format_inference_test
LeoGrin c3dbb82
Merge branch 'main' into datetime_format_inference_test
LeoGrin 8916625
Merge branch 'main' into datetime_format_inference_test
LeoGrin 5fbe28e
Merge branch 'main' into datetime_format_inference_test
LeoGrin 47fe413
Merge branch 'main' into datetime_format_inference_test
LeoGrin 281d45b
All tests pass
LeoGrin 51d9d98
Update changelog
LeoGrin 1d7df6e
Add missing type hints
LeoGrin e6cf3ad
Cleaning
LeoGrin 6998bf8
Typo
LeoGrin f98ea1f
comment change
LeoGrin 86aa61c
simplification
LeoGrin 8c6401b
remove randomness
LeoGrin 28cf679
fix parser tests
LeoGrin a22114c
simplify getting evenly spaced non null
LeoGrin 75bb8f6
update io readme
LeoGrin 6f155b5
revert changed tests
LeoGrin 2b2648e
fix type hints
LeoGrin 3f02e0a
fix type hints for np.unique
LeoGrin feaa7a3
remove prints
LeoGrin 60148b1
fix doc
LeoGrin 6622eba
fix example with febuary 30th
LeoGrin 23b28b9
fix doc
LeoGrin 5cbfb2f
Merge branch 'main' into datetime_format_inference_test
LeoGrin 5422bfa
check if any str at the beginning of _guess_datetime_format_for_array
LeoGrin 3aa3cde
check if any str at the beginning of _guess_datetime_format_for_array
LeoGrin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the warning
UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please...
is raised when any value is a string (if no format was found). Before, it was raised when the first non-null value was a string, so wouldn't be raised in this example, but would be raised onpd.to_datetime(["foo", 1], errors="coerce")
for instance.