Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 3 tasks
XJTLUmedia opened this issue Mar 1, 2023 · 1 comment
Open
1 of 3 tasks

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

XJTLUmedia opened this issue Mar 1, 2023 · 1 comment
Labels
Enhancement Numeric Operations Arithmetic, Comparison, and Logical operations

Comments

@XJTLUmedia
Copy link

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

@XJTLUmedia XJTLUmedia added Enhancement Needs Triage Issue that has not been reviewed by a pandas team member labels Mar 1, 2023
@topper-123
Copy link
Contributor

An weighted minimum doesn't seem to make sense to me. Can you give an example of results from those operations?

@topper-123 topper-123 added Numeric Operations Arithmetic, Comparison, and Logical operations and removed Needs Triage Issue that has not been reviewed by a pandas team member labels May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

No branches or pull requests

2 participants