Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas fill rows with entries occuring less often

df.loc[df[col].value_counts()[df[col]].values < 10, col] = "RARE_VALUE"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #fill #rows #entries #occuring
ADD COMMENT
Topic
Name
6+1 =