Skip to content

bincount fails for complex weights #16903

@feature-engineer

Description

@feature-engineer

bincount would only work for real weights, and not complex ones.

Reproducing code example:

import numpy as np
np.bincount(np.arange(3), weights=1j * np.arange(3))

Error message:

Traceback (most recent call last):
File "", line 1, in
File "<array_function internals>", line 6, in bincount
TypeError: Cannot cast array data from dtype('complex128') to dtype('float64') according to rule 'safe'

Numpy/Python version information:

1.18.4 3.7.7

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy