-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Closed
Description
np.full
says that the resulting array's dtype is np.array(fill_value).dtype
without mention of object arrays, but
In [1]: np.full((1,), None)
Out[1]: array([ nan])
and
In [2]: class C: pass
In [3]: np.full((1,), C())
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-3-e364c2e90930> in <module>()
----> 1 np.full((1,), C())
/usr/lib/python3.4/site-packages/numpy/core/numeric.py in full(shape, fill_value, dtype, order)
286 """
287 a = empty(shape, dtype, order)
--> 288 multiarray.copyto(a, fill_value, casting='unsafe')
289 return a
290
TypeError: float() argument must be a string or a number, not 'C'
Metadata
Metadata
Assignees
Labels
No labels