Skip to content

Commit 109dfb6

Browse files
committed
MAINT: Protect agaisnt fugure changes in NumPy
Avoid dtypes in arrays
1 parent 4f6159b commit 109dfb6

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pandas/tests/series/methods/test_reset_index.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ def test_reset_index_dtypes_on_empty_series_with_multiindex(array, dtype):
126126
# GH 19602 - Preserve dtype on empty Series with MultiIndex
127127
idx = MultiIndex.from_product([[0, 1], [0.5, 1.0], array])
128128
result = Series(dtype=object, index=idx)[:0].reset_index().dtypes
129-
expected = Series(
130-
{"level_0": np.int64, "level_1": np.float64, "level_2": dtype, 0: object}
131-
)
129+
expected = Series([np.int64, np.float64, dtype, object], dtype="object")
130+
expected.index = ["level_0", "level_1", "level_2", 0]
132131
tm.assert_series_equal(result, expected)

pandas/tests/window/test_ewm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def test_ewma_halflife_without_times(halflife_with_times):
108108
@pytest.mark.parametrize("min_periods", [0, 2])
109109
def test_ewma_with_times_equal_spacing(halflife_with_times, times, min_periods):
110110
halflife = halflife_with_times
111-
data = np.arange(10)
111+
data = np.arange(10.)
112112
data[::2] = np.nan
113113
df = DataFrame({"A": data, "time_col": date_range("2000", freq="D", periods=10)})
114114
result = df.ewm(halflife=halflife, min_periods=min_periods, times=times).mean()

0 commit comments

Comments
 (0)