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

Support tuple to (DataFrame|Series).replace() #2095

Merged
merged 2 commits into from
Mar 10, 2021

Conversation

itholic
Copy link
Contributor

@itholic itholic commented Mar 8, 2021

pandas support tuple to (DataFrame|Series).replace() for parameter to_replace and value whereas Koalas doesn't.

We should follow pandas'

>>> df_ks = ks.DataFrame([
...   [1,2,3],
...   [4,5,6],
...   [np.inf, 0, -np.inf]
... ])
>>> df_ks.replace((1, 2), np.nan)
     0    1    2
0  NaN  NaN  3.0
1  4.0  5.0  6.0
2  inf  0.0 -inf

@codecov-io
Copy link

codecov-io commented Mar 8, 2021

Codecov Report

Merging #2095 (ef119ac) into master (1cd113c) will decrease coverage by 5.53%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2095      +/-   ##
==========================================
- Coverage   95.28%   89.74%   -5.54%     
==========================================
  Files          57       57              
  Lines       13244    13130     -114     
==========================================
- Hits        12619    11784     -835     
- Misses        625     1346     +721     
Impacted Files Coverage Δ
databricks/koalas/frame.py 93.41% <100.00%> (-3.20%) ⬇️
databricks/koalas/series.py 95.65% <100.00%> (-1.14%) ⬇️
databricks/koalas/plot/plotly.py 15.78% <0.00%> (-81.06%) ⬇️
...bricks/koalas/tests/plot/test_frame_plot_plotly.py 23.33% <0.00%> (-76.67%) ⬇️
...ricks/koalas/tests/plot/test_series_plot_plotly.py 26.92% <0.00%> (-71.26%) ⬇️
databricks/koalas/usage_logging/__init__.py 27.58% <0.00%> (-64.92%) ⬇️
databricks/koalas/usage_logging/usage_logger.py 47.82% <0.00%> (-52.18%) ⬇️
databricks/koalas/typedef/typehints.py 65.92% <0.00%> (-28.50%) ⬇️
databricks/koalas/__init__.py 77.33% <0.00%> (-14.67%) ⬇️
databricks/conftest.py 87.27% <0.00%> (-12.73%) ⬇️
... and 27 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 1cd113c...ef119ac. Read the comment docs.

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 Mar 10, 2021

Thanks! merging.

@ueshin ueshin merged commit c32bccc into databricks:master Mar 10, 2021
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