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


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

Updated on: 24-Feb-2021

63 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements