def quantile(self, q=<NUM_LIT:0.5>, interpolation='<STR_LIT>'):
def pre_processor(<EOL>vals: np.ndarray<EOL>) -> Tuple[np.ndarray, Optional[Type]]:<EOL><INDENT>if is_object_dtype(vals):<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>inference = None<EOL>if is_integer_dtype(vals):<EOL><INDENT>inference = np.int64<EOL><DEDENT>elif is_datetime64_dtype(vals):<EOL><INDENT>inference = '<STR_LIT>'<EOL>vals = vals.astype(np.float)<EOL><DEDENT>return vals, inference<EOL><DEDENT>def post_processor(<EOL>vals: np.ndarray,<EOL>inference: Optional[Type]<EOL>) -> np.ndarray:<EOL><INDENT>if inference:<EOL><INDENT>if not (is_integer_dtype(inference) and<EOL>interpolation in {'<STR_LIT>', '<STR_LIT>'}):<EOL><INDENT>vals = vals.astype(inference)<EOL><DEDENT><DEDENT>return vals<EOL><DEDENT>return self._get_cythonized_result('<STR_LIT>', self.grouper,<EOL>aggregate=True,<EOL>needs_values=True,<EOL>needs_mask=True,<EOL>cython_dtype=np.float64,<EOL>pre_processing=pre_processor,<EOL>post_processing=post_processor,<EOL>q=q, interpolation=interpolation)<EOL>
Return group values at the given quantile, a la numpy.percentile.

Parameters
----------
q : float or array-like, default 0.5 (50% quantile)
    Value(s) between 0 and 1 providing the quantile(s) to compute.
interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'}
    Method to use when the desired quantile falls between two points.

Returns
-------
Series or DataFrame
    Return type determined by caller of GroupBy object.

See Also
--------
Series.quantile : Similar method for Series.
DataFrame.quantile : Similar method for DataFrame.
numpy.percentile : NumPy method to compute qth percentile.

Examples
--------
>>> df = pd.DataFrame([
...     ['a', 1], ['a', 2], ['a', 3],
...     ['b', 1], ['b', 3], ['b', 5]
... ], columns=['key', 'val'])
>>> df.groupby('key').quantile()
    val
key
a    2.0
b    3.0