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 DataFrame.quantile #984

Merged
merged 10 commits into from
Nov 7, 2019
Merged

Conversation

itholic
Copy link
Contributor

@itholic itholic commented Oct 31, 2019

Resolves #959

>>> kdf = ks.DataFrame({'a': [1, 2, 3, 4, 5], 'b': [6, 7, 8, 9, 0]})
>>> kdf
   a  b
0  1  6
1  2  7
2  3  8
3  4  9
4  5  0

>>> kdf.quantile(.5)
a    3
b    7
Name: 0.5, dtype: int64

>>> kdf.quantile([.25, .5, .75])
      a  b
0.25  2  6
0.5   3  7
0.75  4  8

@codecov-io
Copy link

codecov-io commented Oct 31, 2019

Codecov Report

Merging #984 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #984      +/-   ##
==========================================
+ Coverage   94.84%   94.85%   +0.01%     
==========================================
  Files          34       34              
  Lines        6519     6670     +151     
==========================================
+ Hits         6183     6327     +144     
- Misses        336      343       +7
Impacted Files Coverage Δ
databricks/koalas/missing/frame.py 100% <ø> (ø) ⬆️
databricks/koalas/frame.py 96.32% <100%> (+0.06%) ⬆️
databricks/koalas/generic.py 95.73% <0%> (-0.44%) ⬇️
databricks/koalas/indexes.py 96.41% <0%> (-0.22%) ⬇️
databricks/koalas/groupby.py 91.39% <0%> (ø) ⬆️
databricks/koalas/missing/indexes.py 100% <0%> (ø) ⬆️
databricks/koalas/missing/window.py 100% <0%> (ø) ⬆️
databricks/koalas/missing/series.py 100% <0%> (ø) ⬆️
databricks/koalas/series.py 96.34% <0%> (+0.01%) ⬆️
... and 3 more

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 feca119...f493227. Read the comment docs.

databricks/koalas/frame.py Show resolved Hide resolved
databricks/koalas/frame.py Outdated Show resolved Hide resolved
databricks/koalas/frame.py Outdated Show resolved Hide resolved
databricks/koalas/frame.py Outdated Show resolved Hide resolved
databricks/koalas/frame.py Show resolved Hide resolved
databricks/koalas/frame.py Outdated Show resolved Hide resolved
databricks/koalas/frame.py Show resolved Hide resolved
for column in self._internal.data_columns:
sdf = self._sdf
percentile_cols.append(F.expr(
"approx_percentile(`%s`, array(%s), %s)" % (column, args, accuracy))
Copy link
Member

Choose a reason for hiding this comment

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

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.

HyukjinKwon added a commit that referenced this pull request Nov 5, 2019
…#985)

This PR implement min, max, sum and mean of Expanding in Series and DataFrame

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

relates to #984 977
@softagram-bot
Copy link

Softagram Impact Report for pull/984 (head commit: f493227)

⭐ 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]

@HyukjinKwon HyukjinKwon merged commit 11f8f39 into databricks:master Nov 7, 2019
@itholic itholic deleted the f_quantile branch November 8, 2019 04:54
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.

DataFrame.quantile
5 participants