la.afunc.nans: wrong output for str and object dtype

Bug #582579 reported by kwgoodman
6
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

kwgoodman (kwgoodman)
Changed in larry:
importance: Undecided → Wishlist
assignee: nobody → kwgoodman (kwgoodman)
status: New → In Progress
milestone: none → 0.3
kwgoodman (kwgoodman)
Changed in larry:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.