Skip to main content

NDArray::median

public static function median(NDArray|array|float|int $a): float|int;

The median of the elements in the array. It sorts the array, and if the number of elements is odd, it returns the middle value; if the number of elements is even, it returns the average of the two middle values