Pandas Dataframe.resample() does not overwrite DataFrame

226 Views Asked by At

I don't know why the resample function doesn't work properly.

I'm trying to resample with the simplest example but the function does not overwrite the original dataframe.

import pandas as pd

index = pd.date_range('1/1/2019', periods=8, freq='T')
series = pd.Series(range(8), index=index)
series.resample('3T').sum()

printing the resulting series gives me:

print(series)
>2019-01-01 00:00:00    0
>2019-01-01 00:01:00    1
>2019-01-01 00:02:00    2
>2019-01-01 00:03:00    3
>2019-01-01 00:04:00    4
>2019-01-01 00:05:00    5
>2019-01-01 00:06:00    6
>2019-01-01 00:07:00    7
>Freq: T, dtype: int64

In my use case I wanted to upscale a dataframe but that also didn't work.

0

There are 0 best solutions below