Skip to content

TST/BUG: integer coercion bool with int on windows #12850

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

Closed
jreback opened this issue Apr 10, 2016 · 2 comments
Closed

TST/BUG: integer coercion bool with int on windows #12850

jreback opened this issue Apr 10, 2016 · 2 comments
Labels
Dtype Conversions Unexpected or buggy dtype conversions Windows Windows OS
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Apr 10, 2016

xref #12841

this is a test in test_coercion.py, L361

In [3]: import pandas as pd

In [4]: s = pd.Series([True, False, True, False])

In [5]: s.where(s,1)
Out[5]:
0    1
1    1
2    1
3    1
dtype: int32

on windows the scalar is not coerced to int64 (as it is on other platforms). IIRC .where already has quite complicated logic to do this. How simple is this to fix?

cc @sinhrks

@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions Windows Windows OS labels Apr 10, 2016
@jreback jreback added this to the 0.18.1 milestone Apr 10, 2016
@sinhrks
Copy link
Member

sinhrks commented Apr 10, 2016

Maybe it is caused by NumPy? I don't think everything must be fixed on pandas side, but need to clarify what the current behaviors are.

@jreback
Copy link
Contributor Author

jreback commented Apr 10, 2016

oh it IS caused by numpy as that defaults to int32 when creating integers on windows. However pandas coerces everything internally to int64. So just need to investigate if this is by a bug in the logic somewhere. Or we can just change the test. I'll take a look.

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

Successfully merging a pull request may close this issue.

2 participants