Skip to content

Commit a0a531e

Browse files
committed
added pytest.fixture & whatsnew
1 parent 2677e83 commit a0a531e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

doc/source/whatsnew/v1.4.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ Groupby/resample/rolling
270270
- Bug in :meth:`Series.rolling.apply`, :meth:`DataFrame.rolling.apply`, :meth:`Series.expanding.apply` and :meth:`DataFrame.expanding.apply` with ``engine="numba"`` where ``*args`` were being cached with the user passed function (:issue:`42287`)
271271
- Bug in :meth:`DataFrame.groupby.rolling.var` would calculate the rolling variance only on the first group (:issue:`42442`)
272272
- Bug in :meth:`GroupBy.shift` that would return the grouping columns if ``fill_value`` was not None (:issue:`41556`)
273+
- Bug in :meth:`pandas.DataFrame.ewm`, where non-float64 dtypes were silently failing (:issue:`42452`)
273274

274275
Reshaping
275276
^^^^^^^^^

pandas/tests/window/test_ewm.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ def test_ewma_times_adjust_false_raises():
184184

185185

186186
@pytest.mark.parametrize("func", ["mean", "std", "var"])
187-
@pytest.mark.parametrize("dtype", [np.float32, np.float16, np.float64, float, "float"])
188-
def test_float_dtype_ewma(dtype, func):
187+
def test_float_dtype_ewma(func, float_dtype):
189188
# GH#42452
190189
expected_mean = DataFrame(
191190
{
@@ -203,7 +202,9 @@ def test_float_dtype_ewma(dtype, func):
203202
}
204203
)
205204
expected_var = expected_std ** 2
206-
df = DataFrame({0: range(5), 1: range(6, 11), 2: range(10, 20, 2)}, dtype=dtype)
205+
df = DataFrame(
206+
{0: range(5), 1: range(6, 11), 2: range(10, 20, 2)}, dtype=float_dtype
207+
)
207208
e = df.ewm(alpha=0.5, axis=1)
208209
result = getattr(e, func)()
209210
expected = {

0 commit comments

Comments
 (0)