Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Series.product #1677

Merged
merged 12 commits into from
Aug 4, 2020
Merged

Add Series.product #1677

merged 12 commits into from
Aug 4, 2020

Conversation

itholic
Copy link
Contributor

@itholic itholic commented Jul 26, 2020

Implemented Series.product (Series.prod as an alias).

*Note that since It is implemented by using exp(sum(log(...))) trick, it only works for positive numbers.

>>> ks.Series([]).prod()
1.0
>>> ks.Series([1, 2, 3, 4, 5]).prod()
120
>>> ks.Series([1, np.nan, 3, np.nan, 5]).prod()
15.0

databricks/koalas/series.py Outdated Show resolved Hide resolved
databricks/koalas/tests/test_series.py Outdated Show resolved Hide resolved
databricks/koalas/tests/test_series.py Outdated Show resolved Hide resolved
databricks/koalas/series.py Outdated Show resolved Hide resolved
Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good otherwise.

@itholic
Copy link
Contributor Author

itholic commented Jul 31, 2020

Thanks, @HyukjinKwon .

Copy link
Contributor Author

@itholic itholic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This comment is posted by mistake. I have no idea how to delete this 😅)

Copy link
Collaborator

@ueshin ueshin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, LGTM.

databricks/koalas/series.py Outdated Show resolved Hide resolved
databricks/koalas/series.py Outdated Show resolved Hide resolved
databricks/koalas/series.py Outdated Show resolved Hide resolved
@HyukjinKwon
Copy link
Member

@itholic can you address the comments above?

@HyukjinKwon HyukjinKwon merged commit faf687f into databricks:master Aug 4, 2020
@itholic itholic deleted the prod branch August 11, 2020 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants