Skip to content

Commit c76dc79

Browse files
committed
remove extraneous pd.rolling_sum deprecation warning
1 parent d636a74 commit c76dc79

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pandas/stats/ols.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -1197,8 +1197,11 @@ def _results(self):
11971197

11981198
@cache_readonly
11991199
def _window_time_obs(self):
1200-
window_obs = moments.rolling_sum(self._time_obs_count > 0,
1201-
self._window, min_periods=1)
1200+
window_obs = (Series(self._time_obs_count > 0)
1201+
.rolling(self._window, min_periods=1)
1202+
.sum()
1203+
.values
1204+
)
12021205

12031206
window_obs[np.isnan(window_obs)] = 0
12041207
return window_obs.astype(int)
@@ -1211,8 +1214,7 @@ def _nobs_raw(self):
12111214
# expanding case
12121215
window = len(self._index)
12131216

1214-
result = moments.rolling_sum(self._time_obs_count, window,
1215-
min_periods=1)
1217+
result = Series(self._time_obs_count).rolling(window, min_periods=1).sum().values
12161218

12171219
return result.astype(int)
12181220

0 commit comments

Comments
 (0)