what's the inverse of the quantile function on a pandas Series?

Mannaggia

The quantile functions gives us the quantile of a given pandas series s,

E.g.

s.quantile(0.9) is 4.2

Is there the inverse function (i.e. cumulative distribution) which finds the value x such that

s.quantile(x)=4

Thanks

fernandosjp

I had the same question as you did! I found an easy way of getting the inverse of quantile using scipy.

#libs required
from scipy import stats
import pandas as pd
import numpy as np

#generate ramdom data with same seed (to be reproducible)
np.random.seed(seed=1)
df = pd.DataFrame(np.random.uniform(0,1,(10)), columns=['a'])

#quantile function
x = df.quantile(0.5)[0]

#inverse of quantile
stats.percentileofscore(df['a'],x)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Pandas pd.Series().var() function is giving different output when compared with calculating std manually. Any Idea what's happening wrong here?

From Dev

What is the point of .ix indexing for pandas Series

From Dev

In Go, what's the inverse of reflect.SliceOf()?

From Dev

Inverse of numpy's bincount function

From Dev

Boolean expression: What's the inverse of a 'let myString = aPossibleString'?

From Dev

What is the name parameter in Pandas Series?

From Dev

Does Theano/Numpy's matrix inverse function use GPU at all?

From Dev

Pandas: inverse of value_counts function

From Dev

Is there an Inverse Error Function available in Swift's Foundation import?

From Dev

Function with conditional statement to pandas series

From Dev

quantile normalization on pandas dataframe

From Dev

What is the difference between Pandas Series.apply() and Series.map()?

From Dev

What is the inverse of the numpy cumsum function?

From Dev

What is the inverse of crc32_combine()'s matrix trick?

From Dev

Applying strptime function to pandas series

From Dev

What is Ubuntu's *-series?

From Dev

Pandas DataFrame TypeError: quantile() missing 1 required positional argument: 'quantile'?

From Dev

What is the (kind of) inverse operation to Java's Stream.flatMap()?

From Dev

What is the inverse of the numpy cumsum function?

From Dev

Pandas groupby quantile values

From Dev

What is Ubuntu's *-series?

From Dev

Boolean expression: What's the inverse of a 'let myString = aPossibleString'?

From Dev

Is there an inverse OR function?

From Dev

Is there a builtin "inverse function" of Control.Monad's join?

From Dev

quantile normalization on pandas dataframe

From Dev

Pandas series operator as function parameter

From Dev

What is the difference between Pandas Series.apply() and Series.map()?

From Dev

Pandas select data in q quantile

From Dev

How to use python-colormath's Delta E function with pandas Series

Related Related

  1. 1

    Pandas pd.Series().var() function is giving different output when compared with calculating std manually. Any Idea what's happening wrong here?

  2. 2

    What is the point of .ix indexing for pandas Series

  3. 3

    In Go, what's the inverse of reflect.SliceOf()?

  4. 4

    Inverse of numpy's bincount function

  5. 5

    Boolean expression: What's the inverse of a 'let myString = aPossibleString'?

  6. 6

    What is the name parameter in Pandas Series?

  7. 7

    Does Theano/Numpy's matrix inverse function use GPU at all?

  8. 8

    Pandas: inverse of value_counts function

  9. 9

    Is there an Inverse Error Function available in Swift's Foundation import?

  10. 10

    Function with conditional statement to pandas series

  11. 11

    quantile normalization on pandas dataframe

  12. 12

    What is the difference between Pandas Series.apply() and Series.map()?

  13. 13

    What is the inverse of the numpy cumsum function?

  14. 14

    What is the inverse of crc32_combine()'s matrix trick?

  15. 15

    Applying strptime function to pandas series

  16. 16

    What is Ubuntu's *-series?

  17. 17

    Pandas DataFrame TypeError: quantile() missing 1 required positional argument: 'quantile'?

  18. 18

    What is the (kind of) inverse operation to Java's Stream.flatMap()?

  19. 19

    What is the inverse of the numpy cumsum function?

  20. 20

    Pandas groupby quantile values

  21. 21

    What is Ubuntu's *-series?

  22. 22

    Boolean expression: What's the inverse of a 'let myString = aPossibleString'?

  23. 23

    Is there an inverse OR function?

  24. 24

    Is there a builtin "inverse function" of Control.Monad's join?

  25. 25

    quantile normalization on pandas dataframe

  26. 26

    Pandas series operator as function parameter

  27. 27

    What is the difference between Pandas Series.apply() and Series.map()?

  28. 28

    Pandas select data in q quantile

  29. 29

    How to use python-colormath's Delta E function with pandas Series

HotTag

Archive