A
A
Asya2020-09-16 01:17:05
Python
Asya, 2020-09-16 01:17:05

How to remove duplicate rows from a dataframe?

how to remove duplicate rows from a pandas dataframe?
let's say I have a csv table, I want to do an action similar to the r code, when I can remove duplicates for a specific column:

newdf <- df[!duplicated(df$mycolumn), ]

how to do this in python?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dmshar, 2020-09-16
@asyaevloeva

It's even easier in Pandas:
df.drop_duplicates(["mycolumn"])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question