'Why is duplicated() showing different results on similar codes, of the same dataframe?

I am currently working on an NLP project on my own, and am having some troubles even after reading through the documentations. scraped reddit posts and wanted to find out which posts are duplicated for the 'selftext' and 'title' column. The 3 codes shown below are what was inputted and the results are shown in the picture

May i ask why is there non duplicated posts for code 2 and 3 with reference to code 1?

(1)investing_data[['selftext','title']][investing_data.duplicated(subset=['selftext','title'])]

(2)investing_data[['selftext', 'title']][investing_data.duplicated(subset=['selftext'])]

(3)investing_data[['selftext', 'title']][investing_data.duplicated(subset=['title'])]

screenshot of the 3 codes above



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source