 <p>Generalizing a little to handle an arbitrary number of sentences, we can align your vectors by creating a list of all the words and then iterating over the counts in that order:</p> <pre><code>&gt;&gt;&gt; texts = [text1, text2] &gt;&gt;&gt; counts = [Counter(text) for text in texts] &gt;&gt;&gt; all_words = sorted(set().union(*counts)) &gt;&gt;&gt; vecs = [[count.get(word, 0) for word in all_words] for count in counts] &gt;&gt;&gt; vecs[0] [0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1] &gt;&gt;&gt; vecs[1] [1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1] </code></pre>