la.afunc.nans: wrong output for str and object dtype
Bug #582579 reported by
kwgoodman
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
larry |
Fix Committed
|
Wishlist
|
kwgoodman |
Bug Description
nans (similar to numpy.ones and numpy.zeros) should fill with '' when dtype is str and None when dtype is object. A better error message would be useful for when dtype is int. Current behavior:
>> nans(2)
array([ NaN, NaN]) # <--- Good
>> nans(2, dtype=str)
array(['n', 'n'],
dtype='|S1') # <--- Bad, fill with ''
>> nans(2, dtype=object)
array([nan, nan], dtype=object) # <--- Bad, fill with None
>> nans(2, dtype=int)
[...]
ValueError: cannot convert float NaN to integer # <--- Need better error msg
Related branches
Changed in larry: | |
importance: | Undecided → Wishlist |
assignee: | nobody → kwgoodman (kwgoodman) |
status: | New → In Progress |
milestone: | none → 0.3 |
Changed in larry: | |
status: | In Progress → Fix Committed |
To post a comment you must log in.