Skip to content

BUG/compat: accum funcs changed in numpy 1.18 #29058

Closed
@jbrockmendel

Description

@jbrockmendel

#29057 xfails some tests that are broken with numpy 1.18, which changes the behavior of np.minimum.accumulate on dt64/td64 arrays:

s = pd.Series(
            pd.to_datetime(["NaT", "2000-1-2", "NaT", "2000-1-1", "NaT", "2000-1-3"])
        )

>>> np.minimum.accumulate(s.values)  # numpy 1.17
array([                          'NaT', '2000-01-02T00:00:00.000000000',
       '2000-01-02T00:00:00.000000000', '2000-01-01T00:00:00.000000000',
       '2000-01-01T00:00:00.000000000', '2000-01-01T00:00:00.000000000'],
      dtype='datetime64[ns]')

>>> np.accumulate.minimum(s.values)  # numpy 1.18
array(['NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT'], dtype='datetime64[ns]')

This will need to be addressed in core.generic._make_cum_function (maybe other places too, not sure)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugCompatpandas objects compatability with Numpy or Python functionsNumeric OperationsArithmetic, Comparison, and Logical operations

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions