-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
ENH/POC: infer resolution in array_strptime #55778
Conversation
pandas/_libs/tslibs/strptime.pyx
Outdated
self.creso = item_reso | ||
elif item_reso > self.creso: | ||
self.creso = item_reso | ||
self.creso_changed = True |
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.
So we only want to track if this changes once from the default? e.g.
>>> s = DatetimeParseState("s")
>>> s.update_creso("ms")
>>> s.update_creso("ms")
>>> s.creso_changed # should still return True?
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.
correct. this is a has-it-ever-changed-since-init
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.
Gotcha. Could we rename this like creso_changed_from_default
?
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.
sure, will update
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.
updated
Thanks @jbrockmendel |
array_strptime analogue to #55741, en route to #55564.