Skip to content

Object arrays can't be multiplied by numpy scalars (Trac #1150) #1748

Closed

Description

@thouis

Original ticket http://projects.scipy.org/numpy/ticket/1150 on 2009-06-25 by @inducer, assigned to unknown.

Python 2.5.4 (r254:67916, Feb 18 2009, 03:00:47) 
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.__version__
'1.3.0'
>>> numpy.zeros(5, dtype=object)*5.
array([0.0, 0.0, 0.0, 0.0, 0.0], dtype=object)
>>> numpy.zeros(5, dtype=object)*numpy.float64(5)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for *: 'numpy.ndarray' and 'numpy.float64'

Activity

  1. thouis commented on Oct 19, 2012

    @thouis
    ContributorAuthor

    Milestone changed to 1.4.0 by @cournape on 2009-11-25

  2. thouis commented on Oct 19, 2012

    @thouis
    ContributorAuthor

    Milestone changed to Unscheduled by @mwiebe on 2011-03-24

  3. thouis commented on Oct 19, 2012

    @thouis
    ContributorAuthor

    @teoliphant wrote on 2012-02-16

    This works on version current head of NumPy: a7f5668

  4. thouis commented on Oct 19, 2012

    @thouis
    ContributorAuthor

    @inducer wrote on 2012-02-16

    Confirmed, thanks!

  5. olgabot commented on Jan 9, 2013

    @olgabot

    This doesn't work for me:

    Enthought Python Distribution -- www.enthought.com
    Version: 7.3-2 (64-bit)
    
    Python 2.7.3 |EPD 7.3-2 (64-bit)| (default, Apr 12 2012, 11:14:05) 
    [GCC 4.0.1 (Apple Inc. build 5493)] on darwin
    >>> import numpy
    >>> numpy.zeros(5, dtype=object)*numpy.float64(5)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: unsupported operand type(s) for *: 'numpy.ndarray' and 'numpy.float64'
    >>> numpy.__version__
    '1.6.2'
    

    I'm using the Enthought academic distribution (Python 2.7), which comes with the following packages: http://www.enthought.com/products/epdlibraries.php

    Is it possible there is some cross-talk? This bug prevents me from using machine learning libraries, please fix at your earliest convenience.

    Thanks,
    Olga

  6. njsmith commented on Jan 9, 2013

    @njsmith
    Member

    Your numpy is too old. It's the latest version, granted, but it's too old
    :-). This bug is fixed in 1.7.0, which will be released Any Time Now (or
    you can download the release candidate from the numpy sourceforge page, in
    case you're in a hurry for a quick fix...)

    On Wed, Jan 9, 2013 at 11:26 PM, olgabot [email protected] wrote:

    This doesn't work for me:

    Enthought Python Distribution -- www.enthought.com
    Version: 7.3-2 (64-bit)

    Python 2.7.3 |EPD 7.3-2 (64-bit)| (default, Apr 12 2012, 11:14:05)
    [GCC 4.0.1 (Apple Inc. build 5493)] on darwin

    import numpy
    numpy.zeros(5, dtype=object)*numpy.float64(5)
    Traceback (most recent call last):
    File "", line 1, in
    TypeError: unsupported operand type(s) for *: 'numpy.ndarray' and 'numpy.float64'
    numpy.version
    '1.6.2'

    I'm using the Enthought academic distribution (Python 2.7), which comes
    with the following packages:
    http://www.enthought.com/products/epdlibraries.php

    Is it possible there is some cross-talk? This bug prevents me from using
    machine learning libraries, please fix at your earliest convenience.

    Thanks,
    Olga

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/1748#issuecomment-12072703.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions