@@ -234,17 +234,16 @@ def _validate_get_window_bounds_signature(window: BaseIndexer) -> None:
234
234
f"get_window_bounds"
235
235
)
236
236
237
- def _create_blocks (self , obj : FrameOrSeriesUnion ) :
237
+ def _create_data (self , obj : FrameOrSeries ) -> FrameOrSeries :
238
238
"""
239
239
Split data into blocks & return conformed data.
240
240
"""
241
241
# filter out the on from the object
242
242
if self .on is not None and not isinstance (self .on , Index ):
243
243
if obj .ndim == 2 :
244
244
obj = obj .reindex (columns = obj .columns .difference ([self .on ]), copy = False )
245
- blocks = obj ._to_dict_of_blocks (copy = False ).values ()
246
245
247
- return blocks , obj
246
+ return obj
248
247
249
248
def _gotitem (self , key , ndim , subset = None ):
250
249
"""
@@ -333,7 +332,7 @@ def __repr__(self) -> str:
333
332
334
333
def __iter__ (self ):
335
334
window = self ._get_window (win_type = None )
336
- _ , obj = self ._create_blocks (self ._selected_obj )
335
+ obj = self ._create_data (self ._selected_obj )
337
336
index = self ._get_window_indexer (window = window )
338
337
339
338
start , end = index .get_window_bounds (
@@ -469,7 +468,7 @@ def _apply_series(self, homogeneous_func: Callable[..., ArrayLike]) -> "Series":
469
468
"""
470
469
Series version of _apply_blockwise
471
470
"""
472
- _ , obj = self ._create_blocks (self ._selected_obj )
471
+ obj = self ._create_data (self ._selected_obj )
473
472
474
473
try :
475
474
values = self ._prep_values (obj .values )
@@ -489,7 +488,7 @@ def _apply_blockwise(
489
488
if self ._selected_obj .ndim == 1 :
490
489
return self ._apply_series (homogeneous_func )
491
490
492
- _ , obj = self ._create_blocks (self ._selected_obj )
491
+ obj = self ._create_data (self ._selected_obj )
493
492
mgr = obj ._mgr
494
493
495
494
def hfunc (bvalues : ArrayLike ) -> ArrayLike :
@@ -1268,7 +1267,7 @@ def count(self):
1268
1267
# implementations shouldn't end up here
1269
1268
assert not isinstance (self .window , BaseIndexer )
1270
1269
1271
- _ , obj = self ._create_blocks (self ._selected_obj )
1270
+ obj = self ._create_data (self ._selected_obj )
1272
1271
1273
1272
def hfunc (values : np .ndarray ) -> np .ndarray :
1274
1273
result = notna (values )
@@ -2234,7 +2233,7 @@ def _apply(
2234
2233
def _constructor (self ):
2235
2234
return Rolling
2236
2235
2237
- def _create_blocks (self , obj : FrameOrSeriesUnion ) :
2236
+ def _create_data (self , obj : FrameOrSeries ) -> FrameOrSeries :
2238
2237
"""
2239
2238
Split data into blocks & return conformed data.
2240
2239
"""
@@ -2246,7 +2245,7 @@ def _create_blocks(self, obj: FrameOrSeriesUnion):
2246
2245
list (self ._groupby .grouper .indices .values ())
2247
2246
).astype (np .int64 )
2248
2247
obj = obj .take (groupby_order )
2249
- return super ()._create_blocks (obj )
2248
+ return super ()._create_data (obj )
2250
2249
2251
2250
def _get_cython_func_type (self , func : str ) -> Callable :
2252
2251
"""
0 commit comments