Skip to content

Commit

Permalink
Fix resample sum, prod, size (modin-project#56)
Browse files Browse the repository at this point in the history
Signed-off-by: Naren Krishna <[email protected]>
  • Loading branch information
naren-ponder authored Feb 2, 2023
1 parent 16661e4 commit cb41c6a
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions modin/pandas/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,18 +383,18 @@ def ohlc(self, _method="ohlc", *args, **kwargs):
)
)

def prod(self, _method="prod", min_count=0, *args, **kwargs):
if self.resample_kwargs["axis"] == 0:
result = self.__groups.prod(min_count=min_count, *args, **kwargs)
else:
result = self.__groups.prod(min_count=min_count, *args, **kwargs).T
return result

def size(self):
from .series import Series
def prod(self, _method="prod", *args, **kwargs):
return self._dataframe.__constructor__(
query_compiler=self._query_compiler.resample_prod(
self.resample_kwargs, *args, **kwargs
)
)

return Series(
query_compiler=self._query_compiler.resample_size(self.resample_kwargs)
def size(self, _method="size"):
return self._dataframe.__constructor__(
query_compiler=self._query_compiler.resample_size(
self.resample_kwargs, None, None
)
)

def sem(self, _method="sem", *args, **kwargs):
Expand All @@ -414,12 +414,12 @@ def std(self, ddof=1, *args, **kwargs):
)
)

def sum(self, _method="sum", min_count=0, *args, **kwargs):
if self.resample_kwargs["axis"] == 0:
result = self.__groups.sum(min_count=min_count, *args, **kwargs)
else:
result = self.__groups.sum(min_count=min_count, *args, **kwargs).T
return result
def sum(self, _method="sum", *args, **kwargs):
return self._dataframe.__constructor__(
query_compiler=self._query_compiler.resample_sum(
self.resample_kwargs, *args, **kwargs
)
)

def var(self, ddof=1, *args, **kwargs):
return self._dataframe.__constructor__(
Expand Down

0 comments on commit cb41c6a

Please sign in to comment.