How to create a frequency matrix?
<p>I just started using Python and I just came across the following problem:</p>

<p>Imagine I have the following list of lists: <br></p>

<pre><code>list = [["Word1","Word2","Word2","Word4566"],["Word2", "Word3", "Word4"], ...]
</code></pre>

<p>The result (matrix) i want to get should look like this:
<a href="https://i.stack.imgur.com/5VhbL.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5VhbL.jpg" alt="screenshot"></a></p>

<p>The Displayed Columns and Rows are all appearing words (no matter which list).<br><br>
The thing that I want is a programm that counts the appearence of words in each list (by list).</p>

<p>The picture is the result after the first list.</p>

<p>Is there an easy way to achieve something like this or something similar?</p>

<p><br>
EDIT:
Basically I want a List/Matrix that tells me how many times words 2-4566 appeared when word 1 was also in the list, and so on. <br></p>

<p>So I would get a list for each word that displays the absolute frequency of all other 4555 words in relationship with this word.</p>

<p><br> So I would need an algorithm that iterates through all this lists of words and builts the result lists</p>