Skip to content

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

Closed
wants to merge 4 commits into from
Closed

Conversation

mwiebe
Copy link
Member

@mwiebe mwiebe commented Jun 30, 2011

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.

Mark Wiebe added 2 commits June 29, 2011 18:38
…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')
Copy link
Member

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.

Copy link
Member Author

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'.

@charris
Copy link
Member

charris commented Jun 30, 2011

Good start, I suspect someone could write a small book on the subject ;)

@charris
Copy link
Member

charris commented Jun 30, 2011

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
Copy link
Member Author

Choose a reason for hiding this comment

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

Here's the exception

@mwiebe
Copy link
Member Author

mwiebe commented Jul 1, 2011

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.

@charris
Copy link
Member

charris commented Jul 1, 2011

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?

@charris
Copy link
Member

charris commented Jul 1, 2011

Pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants