Skip to content

Commit

Permalink
Add std and var at rolling and expanding in Series, Frame, SeriesGrou…
Browse files Browse the repository at this point in the history
…pBy, FrameGroupBy
  • Loading branch information
HyukjinKwon committed Nov 11, 2019
1 parent 0baa4f0 commit 72e21b6
Show file tree
Hide file tree
Showing 4 changed files with 339 additions and 28 deletions.
8 changes: 0 additions & 8 deletions databricks/koalas/missing/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ class _MissingPandasLikeExpanding(object):
median = unsupported_function_expanding("median")
quantile = unsupported_function_expanding("quantile")
skew = unsupported_function_expanding("skew")
std = unsupported_function_expanding("std")
validate = unsupported_function_expanding("validate")
var = unsupported_function_expanding("var")

exclusions = unsupported_property_expanding("exclusions")
is_datetimelike = unsupported_property_expanding("is_datetimelike")
Expand All @@ -69,9 +67,7 @@ class _MissingPandasLikeRolling(object):
median = unsupported_function_rolling("median")
quantile = unsupported_function_rolling("quantile")
skew = unsupported_function_rolling("skew")
std = unsupported_function_rolling("std")
validate = unsupported_function_rolling("validate")
var = unsupported_function_rolling("var")

exclusions = unsupported_property_rolling("exclusions")
is_datetimelike = unsupported_property_rolling("is_datetimelike")
Expand All @@ -89,9 +85,7 @@ class _MissingPandasLikeExpandingGroupby(object):
median = unsupported_function_expanding("median")
quantile = unsupported_function_expanding("quantile")
skew = unsupported_function_expanding("skew")
std = unsupported_function_expanding("std")
validate = unsupported_function_expanding("validate")
var = unsupported_function_expanding("var")

exclusions = unsupported_property_expanding("exclusions")
is_datetimelike = unsupported_property_expanding("is_datetimelike")
Expand All @@ -109,9 +103,7 @@ class _MissingPandasLikeRollingGroupby(object):
median = unsupported_function_rolling("median")
quantile = unsupported_function_rolling("quantile")
skew = unsupported_function_rolling("skew")
std = unsupported_function_rolling("std")
validate = unsupported_function_rolling("validate")
var = unsupported_function_rolling("var")

exclusions = unsupported_property_rolling("exclusions")
is_datetimelike = unsupported_property_rolling("is_datetimelike")
Expand Down
12 changes: 12 additions & 0 deletions databricks/koalas/tests/test_expanding.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ def test_expanding_mean(self):
def test_expanding_sum(self):
self._test_expanding_func("sum")

def test_expanding_std(self):
self._test_expanding_func("std")

def test_expanding_var(self):
self._test_expanding_func("var")

def _test_groupby_expanding_func(self, f):
kser = ks.Series([1, 2, 3])
pser = kser.to_pandas()
Expand Down Expand Up @@ -117,3 +123,9 @@ def test_groupby_expanding_mean(self):

def test_groupby_expanding_sum(self):
self._test_groupby_expanding_func("sum")

def test_groupby_expanding_std(self):
self._test_groupby_expanding_func("std")

def test_groupby_expanding_var(self):
self._test_groupby_expanding_func("var")
12 changes: 12 additions & 0 deletions databricks/koalas/tests/test_rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ def test_rolling_sum(self):
def test_rolling_count(self):
self._test_rolling_func("count")

def test_rolling_std(self):
self._test_rolling_func("std")

def test_rolling_var(self):
self._test_rolling_func("var")

def _test_groupby_rolling_func(self, f):
kser = ks.Series([1, 2, 3])
pser = kser.to_pandas()
Expand Down Expand Up @@ -111,3 +117,9 @@ def test_groupby_rolling_mean(self):

def test_groupby_rolling_sum(self):
self._test_groupby_rolling_func("sum")

def test_groupby_rolling_std(self):
self._test_groupby_rolling_func("std")

def test_groupby_rolling_var(self):
self._test_groupby_rolling_func("var")
Loading

0 comments on commit 72e21b6

Please sign in to comment.