Skip to content

arange on timedelta gives a weird error #14713

Closed

Description

@eric-wieser

This error is a weird one

>>> np.arange(12, dtype='m8[M]')
ValueError: arange: cannot use NaT (not-a-time) datetime values

Activity

  1. changed the title [-]Arange on timedelta gives a weird error[/-] [+]arange on timedelta gives a weird error[/+] on Oct 15, 2019
  2. eric-wieser commented on Oct 15, 2019

    @eric-wieser
    MemberAuthor

    I think this is a bug?

    >>> np.arange(0, 12, dtype='m8[M]')
    array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11],
          dtype='timedelta64[M]')
    >>> np.arange(12, dtype='m8[M]')
    ValueError: arange: cannot use NaT (not-a-time) datetime values
    

    I'd propose that both of these should behave like the first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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