def _quantile(data, quantile):
 index = (quantile * (len(data) - 1))
 bottom_index = int(floor(index))
 top_index = int(ceil(index))
 difference = (index - bottom_index)
 output = (((1 - difference) * data[bottom_index]) + (difference * data[top_index]))
 return output

def _quantile ( data , quantile ) : index = ( quantile * ( len ( data ) - 1 ) ) bottom_index = int ( floor ( index ) ) top_index = int ( ceil ( index ) ) difference = ( index - bottom_index ) output = ( ( ( 1 - difference ) * data [ bottom_index ] ) + ( difference * data [ top_index ] ) ) return output
gets a single quantile value for a dataset using r .