Skip to content

ENH: resample().interpolate() #12925

Closed
Closed
@jorisvandenbossche

Description

@jorisvandenbossche

From #12449 (comment)

When downsampling on a Resampler object, you now have different fillna methods to fill the NaNs (or asfreq for a plain reindex like operation without NaN filling). I can possibly make sense to also have interpolate available to fill the missing values directly (instead of first calling mean/asfreq)

In [20]: df = pd.DataFrame(data=[1,3], index=[dt.timedelta(), dt.timedelta(minut
es=3)])

In [21]: df
Out[21]:
          0
00:00:00  1
00:03:00  3

In [22]: df.resample('1T').mean().interpolate('linear')
Out[22]:
                 0
00:00:00  1.000000
00:01:00  1.666667
00:02:00  2.333333
00:03:00  3.000000

Should df.resample('1T').interpolate('linear') give the same result?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions