You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Please Deprecate creation of numpy arrays for arbitrary objects. #6070
NOTE: as discussed at SciPy2015 -- just thought I'd get an issue in.
numpy currently will default to making an dtype-object array for anything it can't make other sense of.
This is hardly ever what someone would want. For example, I just banged my head against a bug due to this:
In [5]: np.array(object)
Out[5]: array(<type 'object'>, dtype=object)
Granted, due to a stupid typo -- but why would anyone want this?
When a user does want the object dtype, numpy almost never can get it right by default anyway, so it's not much burden to have to specify the object dtype if you really want that.
Activity
mhvk commentedon Jul 13, 2015
See also #5353, and #5933 for a wish for more control over object array creation.