I\'m trying to apply a custom function to a rolling window but it gives a KeyError and I\'m not sure why or how to fix it. I\'ve looked here and here, but the answers didn\'