Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Pandas bins pd.cut()

cut_labels_4 = ['silver', 'gold', 'platinum', 'diamond']
cut_bins = [0, 70000, 100000, 130000, 200000]
df['cut_ex1'] = pd.cut(df['ext price'], bins=cut_bins, labels=cut_labels_4)
Source by pbpython.com #
 
PREVIOUS NEXT
Tagged: #Pandas #bins
ADD COMMENT
Topic
Name
5+4 =