Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Quantity from dict does not fail as expected #222

Open
@cybercyber123

Description

@cybercyber123
>>> import quantities as pq>>> pq.__version__'0.14.1'>>> a = [{'x':3, 'y':4},{'x':3, 'y':4}]>>> a * pq.mTraceback (most recent call last):  File ".../pycharm-2022.2.3/plugins/python/helpers/pydev/pydevconsole.py", line 364, in runcode    coro = func()  File "<input>", line 1, in <module>  File ".../PycharmProjects/quantities-bug/venv/lib/python3.10/site-packages/quantities/unitquantity.py", line 207, in __rmul__    return self.view(Quantity).__rmul__(other)  File ".../PycharmProjects/quantities-bug/venv/lib/python3.10/site-packages/quantities/quantity.py", line 341, in __rmul__    return np.multiply(other, self)TypeError: unsupported operand type(s) for *: 'dict' and 'float'>>> pq.Quantity(a, pq.m)array([{'x': 3, 'y': 4}, {'x': 3, 'y': 4}], dtype=object) * m

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp