A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/12925 below:

resample().interpolate() · Issue #12925 · pandas-dev/pandas · GitHub

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?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4