I have a pandas.DataFrame with a column called name containing strings. I would like to get a list of the names which occur more than once in the c
pandas.DataFrame
name
I had a similar problem and came across this answer.
I guess this also works:
counts = df.groupby('name').size() df2 = pd.DataFrame(counts, columns = ['size']) df2 = df2[df2.size>1]
and df2.index will give you a list of names with duplicates
df2.index