#NEWLINE# def quantile( self , q = 0.5 , interpolation = 'linear' ) : #NEWLINE# #INDENT# "\n        Return value at the given quantile, a la numpy.percentile.\n\n        Parameters\n        ----------\n        q : float or array-like, default 0.5 (50% quantile)\n            0 <= q <= 1, the quantile(s) to compute\n        interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'}\n            .. versionadded:: 0.18.0\n\n            This optional parameter specifies the interpolation method to use,\n            when the desired quantile lies between two data points `i` and `j`:\n\n                * linear: `i + (j - i) * fraction`, where `fraction` is the\n                  fractional part of the index surrounded by `i` and `j`.\n                * lower: `i`.\n                * higher: `j`.\n                * nearest: `i` or `j` whichever is nearest.\n                * midpoint: (`i` + `j`) / 2.\n\n        Returns\n        -------\n        quantile : float or Series\n            if ``q`` is an array, a Series will be returned where the\n            index is ``q`` and the values are the quantiles.\n\n        Examples\n        --------\n        >>> s = Series([1, 2, 3, 4])\n        >>> s.quantile(.5)\n        2.5\n        >>> s.quantile([.25, .5, .75])\n        0.25    1.75\n        0.50    2.50\n        0.75    3.25\n        dtype: float64\n\n        " #NEWLINE# self . _check_percentile ( q ) #NEWLINE# if _np_version_under1p9 : #NEWLINE# #INDENT# if ( interpolation != 'linear' ) : #NEWLINE# #INDENT# raise ValueError ( 'Interpolation methods other than linear are not supported in numpy < 1.9.' ) #NEWLINE# #UNINDENT# #UNINDENT# kwargs = dict ( ) #NEWLINE# if ( not _np_version_under1p9 ) : #NEWLINE# #INDENT# kwargs . update ( { #NEWLINE# #INDENT# 'interpolation' : interpolation , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# result = self . _data . quantile ( qs = q , ** kwargs ) #NEWLINE# if com . is_list_like ( result ) : #NEWLINE# #INDENT# index = Float64Index ( q ) #NEWLINE# return self . _constructor ( result , index = index , name = self . name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return result