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

DataFrame.quantile #959

Closed
gatorsmile opened this issue Oct 26, 2019 · 3 comments · Fixed by #984
Closed

DataFrame.quantile #959

gatorsmile opened this issue Oct 26, 2019 · 3 comments · Fixed by #984
Labels
enhancement New feature or request

Comments

@gatorsmile
Copy link
Collaborator

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.quantile.html

df = ks.DataFrame(
  {"a" : [4, 5, 6],
   "b" : [7, 8, 9],
   "c" : [10, 11, 12]},
  index = [1, 2, 3]
)
df.quantile([0.25,0.75])
---------------------------------------------------------------------------
PandasNotImplementedError                 Traceback (most recent call last)
<ipython-input-36-ade0575f6b3c> in <module>
----> 1 df.quantile([0.25,0.75])

/srv/conda/envs/notebook/lib/python3.7/site-packages/databricks/koalas/missing/__init__.py in unsupported_function(*args, **kwargs)
     22     def unsupported_function(*args, **kwargs):
     23         raise PandasNotImplementedError(class_name=class_name, method_name=method_name,
---> 24                                         reason=reason)
     25 
     26     def deprecated_function(*args, **kwargs):

PandasNotImplementedError: The method `pd.DataFrame.quantile()` is not implemented yet.

@HyukjinKwon HyukjinKwon added the enhancement New feature or request label Oct 28, 2019
@HyukjinKwon
Copy link
Member

FYI, there's quantile implementation in Series to refer. cc @itholic, @harupy, @charlesdong1991

@itholic
Copy link
Contributor

itholic commented Oct 29, 2019

@HyukjinKwon Thanks for the inform. so, you mean we have to implement not only DataFrame.quantile but also Series.quantile, right?
ah i got it, we can refer to Series's implementation that already implemented. i've misread.

@itholic
Copy link
Contributor

itholic commented Oct 29, 2019

i just ended up my another work. I'll take this work from now on.

HyukjinKwon pushed a commit that referenced this issue Nov 7, 2019
Resolves #959 

```python
>>> 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
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants