N
N
Nikolai2018-10-02 23:42:23
Python
Nikolai, 2018-10-02 23:42:23

How to display the names of the columns of a csv file in which there is a duplicate cell value?

python 3, pandas latest version.
There is a csv file.
Strings - product url.
Columns - product categories. (That is, one product can be in several categories, as often happens)
Tell me the optimal (or any) algorithm that for each cell will return a list of column names where its duplicate occurs.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Tikhonov, 2018-10-04
@rosweb2018

Rotate the table so that each row has a pair of (url, category (which used to be a column name)).
Then search for duplicate rows.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question