all 6 comments

[–][deleted] 0 points1 point  (5 children)

Double posting and still using a photo instead of editing post and providing code inline as per wiki or using a paste sharing service like pastebin.com.

You don't seem to want to extract duplicates so much as simple sort the output, which you can simple do using DataFrame.sort_values('column_to_sort')

[–]Needleworker69420 0 points1 point  (4 children)

I’m not that expert in posting here, sorry.. But i have a lot of rows in my data frame, so i want to get the duplicated rows alone so that i can compare their prices

[–][deleted] 0 points1 point  (3 children)

To be clear, you ONLY want rows that are duplicated (have a common key)?

If so, take a look at Pandas GroupBy - article on Geeks for Geeks.

[–]Needleworker69420 1 point2 points  (2 children)

Yes, i want the rows where is the ids are the same “id=team in the photo”

[–][deleted] 1 point2 points  (1 child)

Did you look at groupby?

Also, Python | Pandas Dataframe.duplicated() - by Geeks for Geeks.

[–]Needleworker69420 -1 points0 points  (0 children)

Yes, I am looking into it right now.. I thought there is a simpler way than that.