Background:
I'd like to slice a pandas dataframe in elements of a given row length, and perform calculations on them.
pandas.DataFrame.rolling will let me do that, but seemingly only with built-in functions like sum()
in the example df.rolling(2, win_type='triang').sum()
. I would also like to plot these subsets (I'm able to do that by slicing and some For Loops, but it's a bit slow).
What I've found out:
From How can I get the source code of a Python function? I've learnt that I can read source code using pandas.DataFrame.rolling??
which will give me this:
But trying to dig deeper from here using for example rolling??
seems futile:
So, is it possible to reference the underlying functions of pandas.DataFrame.rolling
somehow, or is this where it ends using Python? I guess so since the docs state that pandas is written in Cython or C, but I'm really curious about this so I'd like to ask about this here as well.
Thank you for any suggestions!