While resampling a dataframe (df) as:
df = pd.DataFrame.from_dict({'2021-03-02': 442,
'2021-03-04': 520,
'2021-03-09': 390,
'2021-03-11': 442,
'2021-03-16': 520,
'2021-03-23': 520,
'2021-03-25': 520,
'2021-03-26': 442,}, orient='index',)
df.index = pd.to_datetime(df.index)
df = df.resample('30Min').asfreq()
How do I fill the NANs with values that linearly tend to zero from their predecessor? (a graphic would be looking like a saw)
Are there any built in methods for this operation or a custom method needs to be used in conjuncture with .apply()?
Thank you for your time.
