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

Implement expanding().count() in Series and Frame #978

Merged
merged 1 commit into from
Oct 31, 2019

Conversation

HyukjinKwon
Copy link
Member

@HyukjinKwon HyukjinKwon commented Oct 30, 2019

This PR implements expanding().count():

>>> import databricks.koalas as ks
>>> ks.Series([2, 3, float("nan"), 10]).expanding().count()
0    1.0
1    2.0
2    2.0
3    3.0
Name: 0, dtype: float64
>>> ks.DataFrame({'a': [1, float('nan'), 3], 'b': [1.0, 2.0, 3.0]}).expanding().count()
     a    b
0  1.0  1.0
1  1.0  2.0
2  2.0  3.0

Relates to #977

@HyukjinKwon HyukjinKwon changed the title [WIP] Implement expanding().count() in Series and Frame Implement expanding().count() in Series and Frame Oct 31, 2019
databricks/koalas/window.py Outdated Show resolved Hide resolved
databricks/koalas/window.py Show resolved Hide resolved
@HyukjinKwon HyukjinKwon force-pushed the expanding_count branch 3 times, most recently from 0adacc4 to 157aa84 Compare October 31, 2019 04:31
@softagram-bot
Copy link

Softagram Impact Report for pull/978 (head commit: 46d3a78)

⭐ Change Overview

Showing the changed files, dependency changes and the impact - click for full size
(Open in Softagram Desktop for full details)

📄 Full report

Impact Report explained. Give feedback on this report to [email protected]

raise ValueError("min_periods must be >= 0")
self._min_periods = min_periods
self.kdf_or_kser = kdf_or_kser
if not isinstance(kdf_or_kser, (DataFrame, Series, DataFrameGroupBy, SeriesGroupBy)):
Copy link
Member Author

Choose a reason for hiding this comment

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

I'll fix this one nicer when I add count into DataFrameGroupBy and SeriesGroupBy in a separate PR.

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.

LGTM, pending tests.

@codecov-io
Copy link

codecov-io commented Oct 31, 2019

Codecov Report

Merging #978 into master will increase coverage by 0.02%.
The diff coverage is 98.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #978      +/-   ##
==========================================
+ Coverage   94.82%   94.84%   +0.02%     
==========================================
  Files          34       34              
  Lines        6489     6519      +30     
==========================================
+ Hits         6153     6183      +30     
  Misses        336      336
Impacted Files Coverage Δ
databricks/koalas/missing/window.py 100% <100%> (ø) ⬆️
databricks/koalas/generic.py 96.17% <100%> (ø) ⬆️
databricks/koalas/window.py 92.85% <97.05%> (+6.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0842f4b...46d3a78. Read the comment docs.

@HyukjinKwon HyukjinKwon merged commit 5baedbd into databricks:master Oct 31, 2019
@HyukjinKwon
Copy link
Member Author

Thanks @ueshin !

@HyukjinKwon HyukjinKwon deleted the expanding_count branch November 6, 2019 02:20
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.

4 participants