Skip to content

Conversation

@itholic
Copy link
Contributor

@itholic itholic commented Nov 6, 2019

This PR implement mask of Series
(https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.mask.html#pandas.Series.mask)

>>> s1 = ks.Series([0, 1, 2, 3, 4])
>>> s2 = ks.Series([100, 200, 300, 400, 500])
>>> s1.mask(s1 > 0).sort_index()
0    0.0
1    NaN
2    NaN
3    NaN
4    NaN
Name: 0, dtype: float64

>>> s1.mask(s1 > 1, 10).sort_index()
0     0
1     1
2    10
3    10
4    10
Name: 0, dtype: int64

>>> s1.mask(s1 > 1, s1 + 100).sort_index()
0      0
1      1
2    102
3    103
4    104
Name: 0, dtype: int64

>>> s1.mask(s1 > 1, s2).sort_index()
0      0
1      1
2    300
3    400
4    500
Name: 0, dtype: int64

@codecov-io
Copy link

codecov-io commented Nov 6, 2019

Codecov Report

Merging #1017 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1017      +/-   ##
==========================================
+ Coverage   94.83%   94.83%   +<.01%     
==========================================
  Files          34       34              
  Lines        6640     6641       +1     
==========================================
+ Hits         6297     6298       +1     
  Misses        343      343
Impacted Files Coverage Δ
databricks/koalas/missing/series.py 100% <ø> (ø) ⬆️
databricks/koalas/series.py 96.35% <100%> (ø) ⬆️

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 e596a58...ae6a0b4. Read the comment docs.

@softagram-bot
Copy link

Softagram Impact Report for pull/1017 (head commit: ae6a0b4)

⭐ 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 0696ddf into databricks:master Nov 7, 2019
@itholic itholic deleted the s_mask branch November 8, 2019 04:53
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