nectarchain.trr_test_suite.utils.argmedian#
- argmedian(x, axis=None)[source]#
Returns the index of the median element in the input array
xalong the specified axis.If
axisisNone, the function returns the index of the median element in the flattened array. Otherwise, it computes the argmedian along the specified axis and returns an array of indices.- Args:
x (numpy.ndarray): The input array. axis (int or None, optional): The axis along which to compute the argmedian. If
None, the argmedian is computed on the flattened array.- Returns:
int or numpy.ndarray: The index or indices of the median element(s) in the input array.