1
Hello, you can wear df.drop_duplicates()
to filter the fields. Pandas import is implicit and dataframe creation I will also use your example that is so:
df_sem_duplicacao = df.drop_duplicates(subset=['B'])
df_sem_duplicacao
The parameter subset
receives a list with column labels. By default, df.drop_duplicates()
, removing only those that are exactly equal. But that’s not what we want, so I use the parameter subset
to specify where I want to apply the filter.
Welcome(a) to the platform. And, from now on, I dirty the reading of the following articles: How to ask a good question? and Manual on how NOT to ask questions. Both articles will teach you how to elaborate a good question, avoiding negative and even closing votes. Good luck! Take full advantage of our potential and always come back!
– Solkarped