Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

qcut and cut function in python stack overflow

>>> x=np.array([24,  7,  2, 25, 22, 29])
    >>> x
    array([24,  7,  2, 25, 22, 29])

    >>> pd.cut(x,3).value_counts() #Bins size has equal interval of 9
    (2, 11.0]        2
    (11.0, 20.0]     0
    (20.0, 29.0]     4

    >>> pd.qcut(x,3).value_counts() #Equal frequecy of 2 in each bins
    (1.999, 17.0]     2
    (17.0, 24.333]    2
    (24.333, 29.0]    2
Comment

PREVIOUS NEXT
Code Example
Python :: Finding the Sum of a Symmetrical Sub-List 
Python :: Ranking in Pyspark 
Python :: python geet second item in generator 
Python :: stellargraph python 
Python :: l1=[122, 5, 9, 4] l2=[991, 4, 8, 3] x=[l1[i]-l2[i] for i in range(abs(len(l1)), abs(len(l2)))] print (x) 
Python :: python reverse words and swap case 
Python :: how to detect the body with cv2 
Python :: hewwo world 
Python :: sns countplot show only largest 
Python :: Extract all bounding boxes using OpenCV Python 
Python :: comprehensive python cheat sheet 
Python :: fix misspelled in Wikipedia library on python 
Python :: shotgun meanign 
Python :: pandas read csv read all columns except few columns 
Python :: snipe cmd python.py 
Python :: quicksort python 
Python :: what does << do in python 
Python :: numpy array to int type 
Python :: how to randomise a string in python 
Python :: abstract classes in python 
Python :: TypeError: can only concatenate str (not "list") to str 
Python :: python sort array by lambda 
Python :: size of matrix python 
Python :: list from dataframe python 
Python :: Python How To Convert a String to Variable Name 
Python :: python check for exception 
Python :: cross entropy 
Python :: match in python 
Python :: python virtual env 
Python :: python rounding 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =