Skip to content

BUG: Series([int], dtype="timedelta64[non-nano]") returns 0 result #52457

@mroeschke

Description

@mroeschke

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

In [2]: pd.Series([3600], dtype="timedelta64[s]") Out[2]: 0 0 days dtype: timedelta64[s] In [3]: pd.Series([3600], dtype="timedelta64[s]")._values._ndarray Out[3]: array([0], dtype='timedelta64[s]') In [4]: pd.Series([3600], dtype="timedelta64[ns]")._values._ndarray Out[4]: array([3600], dtype='timedelta64[ns]')

Issue Description

I would expect Out[3] to return array([3600], dtype='timedelta64[s]')

Expected Behavior

array([3600], dtype='timedelta64[s]')

Installed Versions

Replace this line with the output of pd.show_versions()

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugConstructorsSeries/DataFrame/Index/pd.array ConstructorsNon-Nanodatetime64/timedelta64 with non-nanosecond resolutionTimedeltaTimedelta data type

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions