import pandas as pd # Creating a DataFrame with duplicates df = pd.DataFrame({'A': [1, 2, 2, 3, 4, 4], 'B': [5, 6, 6, 7, 8, 8]}) # Check if there are duplicates in the DataFrame has_duplicates = df.duplicated().any() # Print the result print(has_duplicates) >>> True