Skip to content
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

DOC: Documentation and examples for conversion of np.timedelta64 units #26322

Merged
merged 3 commits into from May 6, 2024

Conversation

ajayjanapareddi
Copy link
Contributor

Closes #26121

Thank you for the anamzing work of numpy!

Added documentation and examples, explaining 'safe' and 'unsafe' casting behaviors (with astype) for the timedelta unit (month/year/day) conversions.

This is my first PR on numpy.

Kindly review.

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Cannot cast scalar from dtype('<m8[M]') to dtype('<m8[D]') according to the rule 'safe'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these examples add anything useful, I would just delete everything from line 226 to here. The sentence you added above is enough to explain what's happening.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for reviewing, I have made changes suggested.

@ngoldbaum
Copy link
Member

Thanks @ajayjanapareddi!

@ngoldbaum ngoldbaum merged commit 2270786 into numpy:main May 6, 2024
65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

DOC: undocumented behavior for converting month timedelta64 to days
2 participants