Series.quantile()
Pandas Series.quantile()
returns the value in the given quantile for the underlying data in this Series object.
Syntax: Series.quantile (q = 0.5, interpolation = ’linear’)
Parameter:
q: float or array-like, default 0.5 (50% quantile)
interpolation: {’linear’, ’lower ’,’ higher ’,’ midpoint ’,’ nearest ’}Returns: quantile: float or Series
Example # 1: Use Series.quantile ()
to return the desired quantile of the underlying data in a given Series object.
|
Output:
We will now use Series.quantile ()
to find the quantile 40% of the base data in this series object.
|
Output:
As we can see in the output, Series.quantile ()
successfully returned the desired quantitative value of the underlying data of the given Series object.
Example # 2: Use Series.quantile ()
to return the desired quantile of the underlying data in the given Series object.
|
Output:
Now we will use Series.quantile ()
to find the 90% quantile of the underlying data in a given series object.
|
Output:
As we can see in the output, Series.quantile ()
successfully returned the desired quantitative value for the underlying data of this Series object.