Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pandas series quantile

s = pd.Series([1, 2, 3, 4])
>>> s.quantile(.5)
2.5
>>> s.quantile([.25, .5, .75])
0.25    1.75
0.50    2.50
0.75    3.25
dtype: float64
Comment

pd df quantile

df = pd.DataFrame({'A': [1, 2],
...                    'B': [pd.Timestamp('2010'),
...                          pd.Timestamp('2011')],
...                    'C': [pd.Timedelta('1 days'),
...                          pd.Timedelta('2 days')]})
>>> df.quantile(0.5, numeric_only=False)
A                    1.5
B    2010-07-02 12:00:00
C        1 days 12:00:00
Name: 0.5, dtype: object
Comment

PREVIOUS NEXT
Code Example
Python :: python convert timestamp to datetime 
Python :: python remove element from list 
Python :: how to change turtle shape in python 
Python :: handle queries in listview django 
Python :: how to return total elements in database django 
Python :: pandas add list to dataframe as column 
Python :: python snakes 
Python :: delete spaces in string python 
Python :: factorial in python 
Python :: python datetime strftime 
Python :: threading python 
Python :: how to find outliers in python 
Python :: replace all nan values in dataframe 
Python :: get last element of a list python 
Python :: two sum python 
Python :: flask abort return json 
Python :: integer colomn to datetime pandas 
Python :: python binary tree 
Python :: python sort two key 
Python :: print list in reverse order python 
Python :: remove character from string by index in python 
Python :: how to get a hyperlink in django 
Python :: python sorted word frequency count 
Python :: django static files / templates 
Python :: pandas front fill 
Python :: python unzip list of tuples 
Python :: scikit learn lda 
Python :: python proxy scraper 
Python :: multiple variables in for loop python 
Python :: isnumeric 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =