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

BUG: pd.to_numeric(..., downcast='unsigned') should accept 0 #14401

Closed
jreback opened this issue Oct 12, 2016 · 2 comments
Closed

BUG: pd.to_numeric(..., downcast='unsigned') should accept 0 #14401

jreback opened this issue Oct 12, 2016 · 2 comments
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Oct 12, 2016

with 0.19.0.

In [28]: pd.to_numeric(pd.Series([1,2,3]), downcast='unsigned')
Out[28]: 
0    1
1    2
2    3
dtype: uint8

In [29]: pd.to_numeric(pd.Series([0,1,2,3]), downcast='unsigned')
Out[29]: 
0    0
1    1
2    2
3    3
dtype: int64
In [30]: np.iinfo(np.uint8).min
Out[30]: 0

I think 0 is a legit uint8, so [29] should be uint8.

@jreback jreback added Bug Dtype Conversions Unexpected or buggy dtype conversions labels Oct 12, 2016
@jreback jreback added this to the 0.19.1 milestone Oct 12, 2016
@jreback
Copy link
Contributor Author

jreback commented Oct 12, 2016

cc @gfyoung

@jreback
Copy link
Contributor Author

jreback commented Oct 25, 2016

reverted d1d75d7

@jreback jreback reopened this Oct 25, 2016
@jreback jreback modified the milestones: 0.20.0, 0.19.1 Nov 2, 2016
@jorisvandenbossche jorisvandenbossche modified the milestones: 0.19.2, 0.20.0 Dec 14, 2016
jorisvandenbossche pushed a commit to jorisvandenbossche/pandas that referenced this issue Dec 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment