Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

drop values in column with single frequency

counts_col2 = df.groupby("Col2")["Col2"].transform(len)
counts_col3 = df.groupby("Col3")["Col3"].transform(len)

mask = (counts_col2 > 5) & (counts_col3 > 5)

df[mask]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #drop #values #column #single #frequency
ADD COMMENT
Topic
Name
6+6 =