Skip to content

REGR?: ExponentialMovingWindow.aggregate raises on main with np.mean #58299

@twoertwein

Description

@twoertwein
import numpy as np
import pandas as pd

series = pd.Series(np.random.standard_normal(700))
series.ewm(span=10).aggregate(np.mean)
# 2.2.1: works but warns 'FutureWarning: The provided callable <function mean at 0x7f3e657cf7e0> is currently using ExponentialMovingWindow.mean. In a future version of pandas, the provided callable will be used directly. To keep current behavior pass the string "mean" instead.'

# main: errors:
# AttributeError: 'ExponentialMovingWindow' object has no attribute 'apply'. Did you mean: '_apply'?

series.ewm(span=10).aggregate("mean") # works on both 2.2.1 and main

The warning on 2.2.1 clearly indicates that the behavior will change, but I'm not sure whether the intended future behavior is raising an error :)

xref pandas-dev/pandas-stubs#904

Metadata

Metadata

Assignees

No one assigned

    Labels

    Windowrolling, ewma, expanding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions