Skip to content

Commit 1d40e65

Browse files
committed
rolling moments will return SparseDataFrame now
1 parent d3ca427 commit 1d40e65

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

pandas/stats/moments.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,8 @@ def _rolling_moment(arg, window, func, minp, axis=0, time_rule=None):
8484

8585
def _process_data_structure(arg, kill_inf=True):
8686
if isinstance(arg, DataFrame):
87-
if isinstance(arg, DataMatrix):
88-
return_hook = lambda v: DataMatrix(v, index=arg.index,
89-
columns=arg.columns,
90-
objects=arg.objects)
91-
else:
92-
return_hook = lambda v: DataFrame(v, index=arg.index,
93-
columns=arg.columns)
87+
return_hook = lambda v: type(arg)(v, index=arg.index,
88+
columns=arg.columns)
9489
values = arg.values
9590
elif isinstance(arg, Series):
9691
values = arg.values

0 commit comments

Comments
 (0)