Skip to content

Please Deprecate creation of numpy arrays for arbitrary objects. #6070

Open

Description

@ChrisBarker-NOAA

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

  1. mhvk commented on Jul 13, 2015

    @mhvk
    Contributor

    See also #5353, and #5933 for a wish for more control over object array creation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions