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

combine_first converts dtype from bool to object #3552

Closed
wilsaj opened this issue May 9, 2013 · 3 comments · Fixed by #3555
Closed

combine_first converts dtype from bool to object #3552

wilsaj opened this issue May 9, 2013 · 3 comments · Fixed by #3555
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions
Milestone

Comments

@wilsaj
Copy link

wilsaj commented May 9, 2013

possibly related to #3041 but still present in 0.11 and current HEAD (23f6058)

In [1]: import pandas as pd

In [2]: import numpy as np

In [3]: df1 = pd.DataFrame([[np.nan, 3.,True], [-4.6, np.nan, True], [np.nan, 7., False]])

In [4]: df2 = pd.DataFrame([[-42.6, np.nan, True], [-5., 1.6, False]], index=[1, 2])

In [5]: df1[2]
Out[5]:
0     True
1     True
2    False
Name: 2, dtype: bool

In [6]: df2[2]
Out[6]:
1     True
2    False
Name: 2, dtype: bool

In [7]: df1.combine_first(df2)[2]
Out[7]:
0     True
1     True
2    False
Name: 2, dtype: object
@jreback
Copy link
Contributor

jreback commented May 9, 2013

thanks for the report....I see the problem....tests for the other issue dont cover this

@wilsaj
Copy link
Author

wilsaj commented May 9, 2013

Cool. Thanks for being awesome!

@jreback
Copy link
Contributor

jreback commented May 9, 2013

closed via #3552

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants