Skip to content

ENH: .ewm add min() max() and count() #51706

@XJTLUmedia

Description

@XJTLUmedia

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

As of now .rolling method have min,max,and count method, it would be better if we can use ewm.min() to get min value of two data in series just like rolling.

Feature Description

code copy paste from .rolling method

def max(
       self,
       numeric_only: bool = False,
       *args,
       engine: str | None = None,
       engine_kwargs: dict[str, bool] | None = None,
       **kwargs,
   ):
       nv.validate_window_func("max", args, kwargs)
       if maybe_use_numba(engine):
           if self.method == "table":
               func = generate_manual_numpy_nan_agg_with_axis(np.nanmax)
               return self.apply(
                   func,
                   raw=True,
                   engine=engine,
                   engine_kwargs=engine_kwargs,
               )
           else:
               from pandas.core._numba.kernels import sliding_min_max

               return self._numba_apply(sliding_min_max, engine_kwargs, True)
       window_func = window_aggregations.roll_max
       return self._apply(window_func, name="max", numeric_only=numeric_only, **kwargs)

Alternative Solutions

NA

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions