Skip to content

BUG: incorrect usage of pchip for timedelta #26189

Closed
scipy/scipy
#10090
@jreback

Description

@jreback

This just started breaking on scipy master:
https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=10858

xfailing in #26190

> /Users/jreback/pandas/pandas/tests/series/test_missing.py(1446)test_interpolate_timedelta_index()
-> result = df[0].interpolate(method=method, **kwargs)
(Pdb) n
> /Users/jreback/pandas/pandas/tests/series/test_missing.py(1447)test_interpolate_timedelta_index()
-> expected = pd.Series([0.0, 1.0, 2.0, 3.0], name=0, index=ind)
(Pdb) p result
0 days 00:00:00.000000    0.0
1 days 00:00:00.000000    1.0
2 days 00:00:00.000000    2.0
3 days 00:00:00.000000    3.0
Freq: D, Name: 0, dtype: float64
(Pdb) p df[0]
0 days 00:00:00.000000    0.0
1 days 00:00:00.000000    1.0
2 days 00:00:00.000000    NaN
3 days 00:00:00.000000    3.0
Freq: D, Name: 0, dtype: float64

I think we are passing invalid inputs

> /Users/jreback/pandas/pandas/core/missing.py(311)_interpolate_scipy_wrapper()
-> new_y = method(x, y, new_x, **kwargs)
(Pdb) p method
<function pchip_interpolate at 0x81bb9e9d8>
(Pdb) p x
array([              1,  86400000000001, 259200000000001],
      dtype='timedelta64[ns]')
(Pdb) p y
array([0., 1., 3.])

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions