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

handle nan values in DataFrame.update when overwrite=False #15593 #15617

Closed
wants to merge 1 commit into from

Conversation

pcluo
Copy link
Contributor

@pcluo pcluo commented Mar 8, 2017

closes #15593

@jreback
Copy link
Contributor

jreback commented Mar 8, 2017

can you add some tests from the issue in pandas/tests/frame//test_combine_concat.py

@jreback
Copy link
Contributor

jreback commented Mar 8, 2017

and a whatsnew note (0.20.0) in the bug fixes section

@jreback jreback added Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Mar 8, 2017
@mayukh18
Copy link

mayukh18 commented Mar 8, 2017

I think it should be

if isnull(that).all():
    continue

The line of self[col] = expressions.where(mask, this, that, raise_on_error=True) should be skipped on the absence of values in that i.e. column of the other dataframe whereas mask is computed on this or the column values of base dataframe for overwrite=False.

The committed solution works but is not correct I feel.

@codecov-io
Copy link

Codecov Report

Merging #15617 into master will decrease coverage by -0.03%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master   #15617      +/-   ##
==========================================
- Coverage   91.02%   90.99%   -0.03%     
==========================================
  Files         143      143              
  Lines       49301    49301              
==========================================
- Hits        44875    44863      -12     
- Misses       4426     4438      +12
Impacted Files Coverage Δ
pandas/core/frame.py 97.87% <100%> (-0.1%)
pandas/io/gbq.py 25% <0%> (-58.34%)
pandas/tools/merge.py 91.76% <0%> (-0.35%)
pandas/tseries/index.py 95.29% <0%> (-0.1%)
pandas/core/generic.py 96.25% <0%> (ø)

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 3d69988...02ebf34. Read the comment docs.

@jreback
Copy link
Contributor

jreback commented Apr 18, 2017

closing as stale, if you'd like to update and add some tests pls do.

@jreback jreback closed this Apr 18, 2017
@ngnikhilgoyal
Copy link

I still am receiving the invalid type promotion error in pandas 0.19.2. when using overwrite = False and both old df and new df contain NaN values for same indices. :-(

@pcluo
Copy link
Contributor Author

pcluo commented May 22, 2017

would like to re-open and add a short-term fix for this. just created a pull request #16430. @jreback please advise. long-time user of pandas but first time contributing. thx.

@jreback
Copy link
Contributor

jreback commented May 22, 2017

hmm for some reason not allowing to reopen can just submit another PR (you can use commits from this one) just submit it with a new branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

handle nan values in DataFrame.update when overwrite=False
5 participants