pandas.core.window.rolling.Rolling.apply

函数定义

Rolling.apply(func, raw=False, engine=None, engine_kwargs=None, args=None, kwargs=None)

Calculate the rolling custom aggregation function.

函数主要参数

  • func:function
    Must produce a single value from an ndarray input if raw=True or a single value from a Series if raw=False. Can also accept a Numba JIT function with engine='numba' specified.

  • raw:bool, default None

    • False : passes each row or column as a Series to the function.
    • True : the passed function will receive ndarray objects instead. If you are just applying a NumPy reduction function this will achieve much better performance.
  • args:tuple, default None
    Positional arguments to be passed into func.

  • kwargs:dict, default None
    Keyword arguments to be passed into func.

posted on 2021-12-12 23:41  朴素贝叶斯  阅读(237)  评论(0编辑  收藏  举报

导航