{"id":5280,"date":"2021-05-10T09:32:13","date_gmt":"2021-05-10T04:02:13","guid":{"rendered":"https:\/\/python-programs.com\/?p=5280"},"modified":"2021-11-22T18:42:49","modified_gmt":"2021-11-22T13:12:49","slug":"pandas-find-duplicate-rows-in-a-dataframe-based-on-all-or-selected-columns-using-dataframe-duplicated-in-python","status":"publish","type":"post","link":"https:\/\/python-programs.com\/pandas-find-duplicate-rows-in-a-dataframe-based-on-all-or-selected-columns-using-dataframe-duplicated-in-python\/","title":{"rendered":"Pandas : Find duplicate rows in a Dataframe based on all or selected columns using DataFrame.duplicated() in Python"},"content":{"rendered":"

How to find duplicate rows in a Dataframe based on all or selected columns using DataFrame.duplicate() in Python ?<\/h2>\n

In this article we will discuss about how we can find duplicate rows in a Dataframe based on all or selected columns using DataFrame.duplicated()<\/code>. So first let’s know about this duplicated()<\/code> function then we will see how it actually works.<\/p>\n

DataFrame.duplicated()<\/h3>\n

Python’s Pandas library contains DataFrame class which provides a function i.e. duplicated()<\/code> that helps in finding duplicate rows based on specific or all columns.<\/p>\n

Synatx : DataFrame.duplicated (subset='None', keep='first')<\/pre>\n

where,<\/p>\n