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
Contributor

jreback commented Oct 12, 2016 edited

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 added this to the 0.19.1 milestone Oct 12, 2016

Contributor

jreback commented Oct 12, 2016

jreback closed this in 6ff53c2 Oct 25, 2016

Contributor

jreback commented Oct 25, 2016

reverted d1d75d7

jreback reopened this Oct 25, 2016

@jreback jreback modified the milestone: 0.20.0, 0.19.1 Nov 2, 2016

jreback closed this in b5864b0 Nov 17, 2016

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

@amolkahat Nicholas Ver Halen + amolkahat 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
f145aed

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

@amolkahat Nicholas Ver Halen + amolkahat BUG: to_numeric downcast = 'unsigned' would not un-sign a 0 value
closes #14504
closes #14401
b7c3eec

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

@jorisvandenbossche jorisvandenbossche added a commit to jorisvandenbossche/pandas that referenced this issue Dec 14, 2016

@jorisvandenbossche Nicholas Ver Halen + jorisvandenbossche BUG: to_numeric downcast = 'unsigned' would not un-sign a 0 value
closes #14504
closes #14401

(cherry picked from commit b5864b0)
53eb999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment