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

Comments

Projects
None yet
2 participants
@jreback
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 this to the 0.19.1 milestone Oct 12, 2016

@jreback

This comment has been minimized.

Show comment
Hide comment
@jreback

jreback Oct 12, 2016

Contributor
Contributor

jreback commented Oct 12, 2016

@jreback

This comment has been minimized.

Show comment
Hide comment
@jreback

jreback Oct 25, 2016

Contributor

reverted d1d75d7

Contributor

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

@jreback jreback closed this in b5864b0 Nov 17, 2016

amolkahat added a commit to amolkahat/pandas that referenced this issue Nov 26, 2016

BUG: downcast='unsigned' on 0 would would not downcast to unsigned.
closes #14401

Author: Nicholas Ver Halen <verhalenn@yahoo.com>

Closes #14472 from verhalenn/issue14401 and squashes the following commits:

21e1a97 [Nicholas Ver Halen] Made the downcast limits test its own function.
a62a3f8 [Nicholas Ver Halen] Revert "Added release note to issue 14401 resolve."
7413a9c [Nicholas Ver Halen] Did some editing for some lint problems.
26fe3a1 [Nicholas Ver Halen] Made the dictionaries into one list of sets.
5023fc7 [Nicholas Ver Halen] Changed the test to work with python 3.x
9ccc991 [Nicholas Ver Halen] Changed the tests so that it iterated through a dictionary.
ef35e19 [Nicholas Ver Halen] Added tests for the max and min values of all dtypes to to_numeric
cc278ff [Nicholas Ver Halen] Added release note to issue 14401 resolve.
11a421d [Nicholas Ver Halen] Added a test to check uint8 with 0
11038f8 [Nicholas Ver Halen] Made it so that 0 was included in uint8

amolkahat added a commit to amolkahat/pandas that referenced this issue Nov 26, 2016

@jorisvandenbossche jorisvandenbossche modified the milestones: 0.19.2, 0.20.0 Dec 14, 2016

jorisvandenbossche added 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