0

The rolling.apply() function in panda only allow one column to be operated. (The function to apply can only use the values in one column for calculation). However, in reality, sometimes we need to use the whole frame for calculation like the df.apply() operation. I was wondering how can I define a new rolling.apply() method to make frame-calculation possible via inheritance method.

I have tried serval ways. One is to define a rolling_window function to convert the data into numpy matrix and then use apply_along_axis .However, this method is a bit complex. I also tried to use the latest pandas version , which has a row = True parameter, but it did not work

Wang Reid
  • 9
  • 1

0 Answers0