10000 DOC: Improve datetime64 docs? · Issue #14299 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
DOC: Improve datetime64 docs? #14299
Closed
@anntzer

Description

@anntzer
  • List the inputs forms accepted by the constructor: Right now I think only construction from a string is mentioned; construction from a numeric offset relative to the Unix epoch (a common case, I would think) isn't. Note that this leads to the small footgun
In [1]: np.datetime64(1, 'Y')
Out[1]: numpy.datetime64('1971')

In [2]: np.datetime64('1', 'Y')
Out[2]: numpy.datetime64('0001')

which certainly makes sense (given how other units work) but may be worth mentioning as well.

  • Note on experimentalness of the API: there's still a note at the top saying "The datetime API is experimental in 1.7.0, and may undergo changes in future versions of NumPy." Numpy 1.7 is np.timedelta64(6.5, 'Y') old now; is this note still true?

  • Deemphasize behavior on old versions of numpy: Right now ~30% of the page is about changes in behavior that occurred in numpy 1.7 and in numpy 1.11, which are certainly important for migrating old code but of little interest for many users. Maybe these could be deemphasized somehow, or the examples shortened?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0