title: How to convert dictionary to matrix in python?
body: <p>I have a dictionary like this:</p>
  
  <p>{device1 : (news1, news2, ...), device2 : (news 2, news 4, ...)...}</p>
  
  <p>How to convert them into a 2-D 0-1 matrix in python? Looks like this:</p>
  
  <pre><code>         news1 news2 news3 news4
  device1    1     1     0      0
  device2    0     1     0      1
  device3    1     0     0      1
  </code></pre>