def _get_median(data, n_zeros):
 n_elems = (len(data) + n_zeros)
 if (not n_elems):
  return np.nan
 n_negative = np.count_nonzero((data < 0))
 (middle, is_odd) = divmod(n_elems, 2)
 data.sort()
 if is_odd:
  return _get_elem_at_rank(middle, data, n_negative, n_zeros)
 return ((_get_elem_at_rank((middle - 1), data, n_negative, n_zeros) + _get_elem_at_rank(middle, data, n_negative, n_zeros)) / 2.0)

def _get_median ( data , n_zeros ) : n_elems = ( len ( data ) + n_zeros ) if ( not n_elems ) : return np . nan n_negative = np . count_nonzero ( ( data < 0 ) ) ( middle , is_odd ) = divmod ( n_elems , 2 ) data . sort ( ) if is_odd : return _get_elem_at_rank ( middle , data , n_negative , n_zeros ) return ( ( _get_elem_at_rank ( ( middle - 1 ) , data , n_negative , n_zeros ) + _get_elem_at_rank ( middle , data , n_negative , n_zeros ) ) / 2.0 )
compute the median of data with n_zeros additional zeros .