Return the high median of data.

    When the number of data points is odd, the middle value is returned.
    When it is even, the larger of the two middle values is returned.
549673
def median_high(data):
    
    data = sorted(data)
    n = len(data)
    if n == 0:
        raise StatisticsError("no median for empty data")
    return data[n // 2]
1164458
def median_interval(self, name, alpha=_alpha, **kwargs):
        
        data = self.get(name,**kwargs)
        return median_interval(data,alpha)
1040527
public static <T, U> Collector<T, ?, Optional<U>> median(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
        return percentile(0.5, function, comparator);
    }
132532
function() {
			// Handle the single element case
			if (this.length == 1) {
				return this.arr[0];
			}

			// Sort the numbers
			var nums = this.clone().sort();

			// The third quartile is the median of the upper half of the numbers
			return nums.slice(Math.ceil(nums.size() / 2)).median();
		}
717328
def median_fill(adf):
        
        ordpt = adf.values[0]
        if not pd.isnull(ordpt):
            return ordpt

        fdmn = adf.iloc[1:-1].median()
        if not pd.isnull(fdmn):
            return fdmn

        flspt = adf.values[-1]
        if not pd.isnull(flspt):
            return flspt

        return nan
858220
def mean(data):
    """"""
    #: http://stackoverflow.com/a/27758326
    n = len(data)
    if n < 1:
        raise ValueError('mean requires at least one data point')
    return sum(data)/n
213161
def median(self, name, **kwargs):
        
        data = self.get(name,**kwargs)
        return np.percentile(data,[50])
234160
def midpoint(self) -> float:
        
        return (self.bid + self.ask) / 2 if self.hasBidAsk() else nan
507091
public static <T> T median(List<? extends T> data, Comparator<? super T> comparator) {
    return median(data, comparator, 0, data.size());
  }
936468
def flag_calcmad(data):
    

    absdev = np.abs(data - np.median(data))
    return np.median(absdev)
336233
public static <T, U extends Comparable<? super U>> Collector<T, ?, Optional<U>> median(Function<? super T, ? extends U> function) {
        return percentile(0.5, function);
    }
42191
def high(self):
        """"""
        with self.lock:
            try:
                return self.data[0][1]
            except IndexError as ex:
                ex.args = ('DEPQ is empty',)
                raise
531069
def mean(data):
    
    if iter(data) is data:
        data = list(data)
    n = len(data)
    if n < 1:
        raise StatisticsError('mean requires at least one data point')
    return sum(data) / n
292790
public function median()
    {
        if ($this->n < 1) {
            throw new RuntimeException('Median is not defined for vectors'
                . ' with less than 1 element.');
        }

        $mid = intdiv($this->n, 2);

        $a = $this->a;

        sort($a);

        if ($this->n % 2 === 1) {
            $median = $a[$mid];
        } else {
            $median = ($a[$mid - 1] + $a[$mid]) / 2.;
        }

        return $median;
    }
406294
def calculate_median(given_list):
        
        median = None

        if not given_list:
            return median

        given_list = sorted(given_list)
        list_length = len(given_list)

        if list_length % 2:
            median = given_list[int(list_length / 2)]
        else:
            median = (given_list[int(list_length / 2)] + given_list[int(list_length / 2) - 1]) / 2.0

        return median
1045695
function() {
			// Get the median and the range that the number must fall within
			var median = this.median();
			var range  = this.iqr() * 1.5;

			// Create a new stats object to hold the outliers
			var outliers = stats([]);

			// Go through each element in the data set and test to see if it
			// is an outlier
			this.each(function(num) {
				if (Math.abs(num - median) > range) {
					// The number is an outlier
					outliers.push(num);
				}
			});

			return outliers;
		}
960127
def median(data, freq_col=1):
    

    nr_data = _nr_data(data, freq_col)
    median_idx = nr_data / 2
    i = 0
    for d in data:
        i += d[freq_col]
        if i >= median_idx:
            return d
    raise Exception("??? median ???")