Answers for "drop values in column with single frequency"

0

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]
Posted by: Guest on January-17-2022

Code answers related to "drop values in column with single frequency"

Python Answers by Framework

Browse Popular Code Answers by Language