Skip to content

Numpy element-wise minimum/maximum not supported #53

Open

Description

@jgosmann
In [69]: np.maximum(0.0, 1.0)
Out[69]: 1.0

In [70]: np.maximum(0.0 * pq.dimensionless, 1.0*pq.dimensionless)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-70-ffce8e18747f> in <module>()
----> 1 np.maximum(0.0 * pq.dimensionless, 1.0*pq.dimensionless)

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/quantities/quantity.pyc in __array_prepare__(self, obj, context)
    234                 """ufunc %r not supported by quantities
    235                 please file a bug report at https://github.com/python-quantities
--> 236                 """
    237                 )
    238         return res

ValueError: ufunc %r not supported by quantities
                please file a bug report at https://github.com/python-quantities

Activity

  1. Atcold commented on Mar 7, 2020

    @Atcold

    How can one go around this?
    Okay, using .magnitude one can access the internal value.

  2. added
    bug
    numpy-integration
    on Nov 17, 2026
  3. added this to the 0.18.0 milestone on Nov 17, 2026
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

    bugnumpy-integration

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions