Detecting duplicate values in a Pandas dataframe

1. Using the pandas duplicated() function

Using the duplicated() function, which returns a boolean mask indicating which rows are duplicates

2. Using the pandas drop_duplicates() function

Using the drop_duplicates() function, which returns a new DataFrame with duplicate rows removed

3. Using the pandas groupby() function

Using the groupby() function, which groups the DataFrame by all columns and returns the count of occurrences for each group

4. Using python's built-in set() function

Using Python’s built-in set() function and apply() method to convert each row to a tuple, and then checking for duplicates using the duplicated() function

5.Using python's built-in Counter() function

Using Python’s built-in Counter() function to count the occurrences of each tuple of values, and then checking if any of the counts are greater than 1.