[DataFrame] Implemented prod, product, added test suite#1994
[DataFrame] Implemented prod, product, added test suite#1994devin-petersohn merged 12 commits intoray-project:masterfrom
Conversation
| @@ -0,0 +1,353 @@ | |||
| from __future__ import absolute_import | |||
There was a problem hiding this comment.
We should remove this file.
|
Test FAILed. |
|
Test PASSed. |
|
|
||
| return self._arithmetic_helper(remote_func, axis, level) | ||
|
|
||
| def product(self, axis=None, skipna=None, level=None, numeric_only=None, |
There was a problem hiding this comment.
Pandas defines product as an alias of prod, so we should do the same.
|
Test PASSed. |
devin-petersohn
left a comment
There was a problem hiding this comment.
Looks great! Just a couple of minor changes.
|
|
||
| @pytest.fixture | ||
| def test_prod(ray_df, pandas_df): | ||
| assert(ray_df_equals_pandas(ray_df.prod().sort_index(), pandas_df.prod().sort_index())) |
There was a problem hiding this comment.
Please remove sort_index() from each side of this. The index should come out the same.
| ray_df.product() | ||
| @pytest.fixture | ||
| def test_product(ray_df, pandas_df): | ||
| assert(ray_df_equals_pandas(ray_df.product().sort_index(), pandas_df.product().sort_index())) |
There was a problem hiding this comment.
Same as above regarding sort_index().
devin-petersohn
left a comment
There was a problem hiding this comment.
After you rebase and replace the newlines, looks good!
| pd_obj = getattr(pd.DataFrame, attr, None) | ||
| if callable(pd_obj) or isinstance(pd_obj, property): | ||
| assert obj.__doc__ == pd_obj.__doc__ | ||
|
No newline at end of file |
python/ray/dataframe/dataframe.py
Outdated
| return pd.DataFrame(columns=left_columns, index=[0], dtype='uint8').merge( | ||
| pd.DataFrame(columns=right_columns, index=[0], dtype='uint8'), | ||
| *args).columns | ||
| *args).columns No newline at end of file |
|
Test FAILed. |
|
Test PASSed. |
|
Test PASSed. |
|
Test PASSed. |
|
Prod returns a Series, but I was using a dataframe check instead. This commit should resolve the issue |
|
Test PASSed. |
|
Merged, thanks @hsubbaraj! |
* master: (21 commits) Expand local_dir in Trial init (ray-project#2013) Fixing ascii error for Python2 (ray-project#2009) [DataFrame] Implements df.update (ray-project#1997) [DataFrame] Implements df.as_matrix (ray-project#2001) [DataFrame] Implement quantile (ray-project#1992) [DataFrame] Impement sort_values and sort_index (ray-project#1977) [DataFrame] Implement rank (ray-project#1991) [DataFrame] Implemented prod, product, added test suite (ray-project#1994) [DataFrame] Implemented __setitem__, select_dtypes, and astype (ray-project#1941) [DataFrame] Implement diff (ray-project#1996) [DataFrame] Implemented nunique, skew (ray-project#1995) [DataFrame] Implements filter and dropna (ray-project#1959) [DataFrame] Implements df.pipe (ray-project#1999) [DataFrame] Apply() for Lists and Dicts (ray-project#1973) Clean up syntax for supported Python versions. (ray-project#1963) [DataFrame] Implements mode, to_datetime, and get_dummies (ray-project#1956) [DataFrame] Fix dtypes (ray-project#1930) keep_dims -> keepdims (ray-project#1980) add pthread linking (ray-project#1986) [DataFrame] Add layer of abstraction to allow OID instantiation (ray-project#1984) ...
* master: (25 commits) [DataFrame] Add direct pandas imports for MVP (ray-project#1960) Make ActorHandles pickleable, also make proper ActorHandle and ActorC… (ray-project#2007) Expand local_dir in Trial init (ray-project#2013) Fixing ascii error for Python2 (ray-project#2009) [DataFrame] Implements df.update (ray-project#1997) [DataFrame] Implements df.as_matrix (ray-project#2001) [DataFrame] Implement quantile (ray-project#1992) [DataFrame] Impement sort_values and sort_index (ray-project#1977) [DataFrame] Implement rank (ray-project#1991) [DataFrame] Implemented prod, product, added test suite (ray-project#1994) [DataFrame] Implemented __setitem__, select_dtypes, and astype (ray-project#1941) [DataFrame] Implement diff (ray-project#1996) [DataFrame] Implemented nunique, skew (ray-project#1995) [DataFrame] Implements filter and dropna (ray-project#1959) [DataFrame] Implements df.pipe (ray-project#1999) [DataFrame] Apply() for Lists and Dicts (ray-project#1973) Clean up syntax for supported Python versions. (ray-project#1963) [DataFrame] Implements mode, to_datetime, and get_dummies (ray-project#1956) [DataFrame] Fix dtypes (ray-project#1930) keep_dims -> keepdims (ray-project#1980) ...
* master: [DataFrame] Add direct pandas imports for MVP (ray-project#1960) Make ActorHandles pickleable, also make proper ActorHandle and ActorC… (ray-project#2007) Expand local_dir in Trial init (ray-project#2013) Fixing ascii error for Python2 (ray-project#2009) [DataFrame] Implements df.update (ray-project#1997) [DataFrame] Implements df.as_matrix (ray-project#2001) [DataFrame] Implement quantile (ray-project#1992) [DataFrame] Impement sort_values and sort_index (ray-project#1977) [DataFrame] Implement rank (ray-project#1991) [DataFrame] Implemented prod, product, added test suite (ray-project#1994) [DataFrame] Implemented __setitem__, select_dtypes, and astype (ray-project#1941) [DataFrame] Implement diff (ray-project#1996) [DataFrame] Implemented nunique, skew (ray-project#1995) [DataFrame] Implements filter and dropna (ray-project#1959) [DataFrame] Implements df.pipe (ray-project#1999) [DataFrame] Apply() for Lists and Dicts (ray-project#1973)
Implemented prod, product
pandas test suite for min, max, cumulative functions, sum, prod, product
added an additional missing parameter to sum