convert dictionary to sparse matrix
<p>I have a dictionary with keys as user_ids and values as list of movie_ids liked by that user with #unique_users = 573000 and # unique_movies =16000. </p>

<blockquote>
  <p>{1: [51, 379, 552, 2333, 2335, 4089, 4484],
               2: [51, 379, 552, 1674, 1688, 2333, 3650, 4089, 4296, 4484],
               5: [783, 909, 1052, 1138, 1147, 2676],
               7: [171, 321, 959],
               9: [3193],
               10: [959],
               11: [131,567,897,923],..........}</p>
</blockquote>

<p>Now i want to convert this into  into a matrix with rows as user_ids and columns as movies_id with values 1 for the movies which user has liked i.e it will be 573000*16000</p>

<p>Ultimately i have to multiply this matrix with it's transpose to have co-occurrence matrix with dim (#unique_movies,#unique_movies).</p>

<p>Also, what will be the time complexity of X'*X operation where X is like (500000,12000).</p>