Open
Description
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