nezaslo4
nezaslo4

Reputation: 35

Calculating quantiles for whole dataframe in pandas

I have dataframe in jupyter notebook (pandas) where mean, standard deviation, description etc. works properly.

When I tried to calculate quantiles with this code (arguments are from pandas documentation):

path = r'p_80'
frame = ioi_frame(path) #gives me dataframe

q1 = frame.quantile(0.25, method="table")
q1

[That is dataframe I put in code]

2

I get output:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_12792/1566283168.py in <module>
      2 frame = ioi_frame(path)
      3 
----> 4 q1 = frame.quantile(0.25, method="table")
      5 q1

TypeError: quantile() got an unexpected keyword argument 'method'

Let me know, why method is not working and how could I calculate quantiles for the whole dataframe?

Upvotes: 1

Views: 358

Answers (1)

RustyPython
RustyPython

Reputation: 530

From the pandas docs you linked for the method parameter

 When ‘table’, the only allowed interpolation methods are ‘nearest’, ‘lower’, and ‘higher’.

As an interpolation was not specified it uses the default linear

Try using one of the allowed interpolation parameters and see if that works.

Upvotes: 1

Related Questions