-
-
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
BUG: Timestamp.normalize()
can overflow silently
#60583
Comments
Timestamp.normalize()
Timestamp.normalize()
can overflow silently (vs .floor()
which raises)
I don't think the above mention is a bug. The reason is because- |
@shashankrushiya I'm not following. How does that mean it's not a bug?
So then why doesn't BTW, note that |
Timestamp.normalize()
can overflow silently (vs .floor()
which raises)Timestamp.normalize()
can overflow silently
Thanks for the report! Agreed normalize should raise an OverflowError here. PRs to fix are welcome!
I view this as a violation of pandas' Code of conduct and ask you to refrain from making such statements in the future. We'd like to make pandas a welcome place for all contributors, and this type of comment works against this goal. |
@rhshadrach My bad. I've edited my above comment to be respectful and more constructive. Sorry @shashankrushiya! |
take |
"Agreed normalize should raise an OverflowError here. PRs to fix are welcome!" What file should be modified for this PR? I understand that what the original poster posted is in fact a bug, but I don't know what files one should look in to try to understand the cause of this unexpected behavior. Specifically I was looking through: pandas/pandas/core/arrays/datetimes.py Line 1148 in 59b3a1a
But looking through these files does not explain what causes the bug.
|
Pandas version checks
is:issue normalize overflow
Issue description
I was trying to get the minimum date, so I tried
pd.Timestamp.min.normalize()
before realizing that would be out of range, but what's weird is that it overflows without warning:For reference:
Compare that to
.floor('D')
, which I thought would be equivalent, but it raises:as well as
.round('D')
(same error).Sidenote: What I really wanted was
.ceil('D')
, which gets the first whole day:Installed Versions
The text was updated successfully, but these errors were encountered: