You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/05/17 20:36:24 UTC
[GitHub] [beam] TheNeuralBit commented on a change in pull request #14468: [BEAM-9547] Add support for std and var to DataFrame
TheNeuralBit commented on a change in pull request #14468:
URL: https://github.com/apache/beam/pull/14468#discussion_r633852136
##########
File path: sdks/python/apache_beam/dataframe/frames_test.py
##########
@@ -1059,6 +1059,18 @@ def test_insert(self):
lambda df: df.insert(0, 'foo', pd.Series([8], index=[1])), df)
self._run_inplace_test(lambda df: df.insert(2, 'bar', value='q'), df)
+ def test_series_agg_std(self):
+ s = pd.Series(range(10))
+
+ self._run_test(lambda s: s.agg('std'), s)
+ self._run_test(lambda s: s.agg('var'), s)
+ self._run_test(lambda s: s.agg(['std', 'sum']), s)
+ self._run_test(lambda s: s.agg(['var']), s)
+
+ def test_dataframe_std(self):
+ self._run_test(lambda df: df.std(numeric_only=True), GROUPBY_DF)
+ self._run_test(lambda df: df.var(numeric_only=True), GROUPBY_DF)
Review comment:
Good idea, done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org