-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Datetime documentation draft #101
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
Conversation
…ime64 This is from user feedback, indicating that always having to type the '6' was very annoying. Unfortunately, there are still the functions datetime_as_date and datetime_data which prevent the autocomplete from working right.
|
||
.. admonition:: Example | ||
|
||
>>> np.datetime64('2005') == np.datetime64('2005-01-01') |
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.
I assume that the year in this and similar example corresponds to the earliest time compatible with both sides of the comparison.
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.
Not really 'compatible with', more 'equal by definition'.
Good start, I suspect someone could write a small book on the subject ;) |
Is there an easy way to get the day of the week? |
>>> np.busday_offset('2011-06-25', 2) | ||
Traceback (most recent call last): | ||
File "<stdin>", line 1, in <module> | ||
ValueError: Non-business day date in busday_offset |
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.
Here's the exception
There is an easy way to get the day of the week, basically subtract a particular monday then do a modulo 7. There probably will need to be some assorted helper functions written in Python that implement this kind of stuff. |
Yeah, I know how to do it ;) Just wondering if there was a function for it since it is likely to be a common calculation. Looks good to me, want me to do the commit? |
Pushed. |
feat: Add vqdmull_s16
An initial draft of introductory datetime documentation.
I've called the next NumPy 1.7 in the doc, because with people still testing Python 2.4, and the amount of ABI-compatible changes already done, that's likely what will be released.