Write a program in Python to calculate the default float quantile value for all the element in a Series

PythonPandasServer Side ProgrammingProgramming

Input

Assume you have a series and default float quantile

value is 3.0

Solution

To solve this, we will follow the steps given below −

  • Define a Series

  • Assign quantile default value .5 to the series and calculate the result. It is defined below,

data.quantile(.5)

Example

Let us see the complete implementation to get a better understanding −

import pandas as pd
l = [10,20,30,40,50]
data = pd.Series(l)
print(data.quantile(.5))

Output

30.0
raja
Published on 11-Feb-2021 09:51:11
Advertisements