Skip to content

Conversation

@HyukjinKwon
Copy link
Member

@HyukjinKwon HyukjinKwon commented Dec 4, 2019

This PR completes NumPy's ufunc support (followup of #1096).

See also https://docs.scipy.org/doc/numpy/reference/arrays.classes.html#standard-array-subclasses

E.g.:

>>> import databricks.koalas as ks
>>> import numpy as np
>>> kdf = ks.range(10)
>>> kser = np.sqrt(kdf.id)
>>> type(kser)
<class 'databricks.koalas.series.Series'>
>>> kser
0    0.000000
1    1.000000
2    1.414214
3    1.732051
4    2.000000
5    2.236068
6    2.449490
7    2.645751
8    2.828427
9    3.000000

@HyukjinKwon HyukjinKwon changed the title Complete NumPy ufunc compatibility Complete NumPy ufunc compatibility in Series Dec 4, 2019
@codecov-io
Copy link

codecov-io commented Dec 4, 2019

Codecov Report

Merging #1106 into master will increase coverage by 0.01%.
The diff coverage is 91.17%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1106      +/-   ##
==========================================
+ Coverage   95.19%   95.21%   +0.01%     
==========================================
  Files          34       35       +1     
  Lines        6935     6953      +18     
==========================================
+ Hits         6602     6620      +18     
  Misses        333      333
Impacted Files Coverage Δ
databricks/koalas/base.py 96.05% <100%> (+1.17%) ⬆️
databricks/koalas/numpy_compat.py 90% <90%> (ø)

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 ad946fb...b59e233. Read the comment docs.

@softagram-bot
Copy link

Softagram Impact Report for pull/1106 (head commit: b59e233)

⚠️ Copy paste found

ℹ️ test_numpy_compat.py: Copy paste fragment on line 24 shared with ../test_dataframe.py:


    @property
    def pdf(self):
        return pd.DataFrame({
            'a': [1, 2, 3, 4, 5, 6, 7, 8, 9],
            'b': [4, 5, 6, 3, 2, 1, ...(truncated 160 chars)

ℹ️ test_numpy_compat.py: Copy paste fragment on line 24 shared with ../test_dataframe.py, ../test_indexes.py:


    @property
    def pdf(self):
        return pd.DataFrame({
            'a': [1, 2, 3, 4, 5, 6, 7, 8, 9],
            'b': [4, 5, 6, 3, 2, 1, ...(truncated 160 chars)

ℹ️ test_numpy_compat.py: Copy paste fragment on line 27 shared with ../test_dataframe.py, ../test_indexes.py, ../test_ops_on_diff_frames.py:

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

    @propert...(truncated 20 chars)

Now that you are on the file, it would be easier to pay back some tech. debt.

⭐ 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
Copy link
Member Author

tests passed.

np.random.randint(-100, 100, size=(np.random.randint(100), 2)), columns=['a', 'b'])
kdf = ks.from_pandas(pdf)

blacklist = [
Copy link
Member Author

Choose a reason for hiding this comment

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

Btw, I ran it few hundreds times and it seems not flaky.

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.

@ueshin
Copy link
Collaborator

ueshin commented Dec 4, 2019

Thanks! merging.

@ueshin ueshin merged commit 054be21 into databricks:master Dec 4, 2019
@HyukjinKwon HyukjinKwon deleted the fallback-ufunc branch September 11, 2020 07:52
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.

5 participants