-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Closed
Labels
00 - Bugcomponent: numpy.libsprintableIssue fits the time-frame and setting of a sprintIssue fits the time-frame and setting of a sprint
Description
Describe the issue:
Complex numbers are unordered. The complex set, ℂ, is isomorphic with ℝ², which is an unordered vector space. On the other hand, quantiles are the inverse of the cumulative distribution function, CDF. Which is monotonic. It must be, for its inverse to exist.
Consequentially, it makes no mathematical sense to apply quantiles to an unordered set, like a complex input array. Some order can be introduced (e.g., lexicographic) but it is artificial, without a sound mathematical support.
However, both sorting and quantiles functions work in numpy (see example below). Instead, an exception should be thrown.
Reproduce the code example:
import numpy as np
arr_c = np.array([0.5+3.0j, 2.1+0.5j, 1.6+2.3j], dtype=np.dtype('complex128'))
np.quantile(arr_c, 0.5)Error message:
No response
NumPy/Python version information:
1.23.3 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 06:04:10)
[GCC 10.3.0]
Context for the issue:
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
00 - Bugcomponent: numpy.libsprintableIssue fits the time-frame and setting of a sprintIssue fits the time-frame and setting of a sprint