0

I have the following dict that contains user name (key) and subreddits list[value]: {user1:[sub1, sub2, sub3...., subn], user2:[sub1, sub3, sub100, ..., subx],....}

I also have this as dataframe with columns 'user' and 'subreddits' (subreddits is a string but can be converted to list of strings like in the dict if it matters).

I need to convert them to 2 sparse matrix and then multiply and get argmax for each row. the axis are the subreddits and the rows are the users name. It's important to know the i and j at all time because the goal is to find users with same subreddits.

How should I approach this? Thanks!

juli
  • 1
  • 3
  • [Going from a long-form dataframe to a sparse matrix is pretty easy](https://stackoverflow.com/questions/67158157/how-to-go-from-a-tsv-with-feature-list-strings-to-a-csr-matrix-in-python/67164799) – CJR Oct 29 '21 at 14:35

0 Answers0