title: Analogue of Python's defaultdict?
body: <p>Is there a .NET analogue of Python's <a href="http://docs.python.org/2/library/collections.html#collections.defaultdict" rel="noreferrer"><code>defaultdict</code></a>? I find it useful to write short code, eg. counting frequencies:</p>
  
  <pre><code>&gt;&gt;&gt; words = "to be or not to be".split()
  &gt;&gt;&gt; print words
  ['to', 'be', 'or', 'not', 'to', 'be']
  &gt;&gt;&gt; from collections import defaultdict
  &gt;&gt;&gt; frequencies = defaultdict(int)
  &gt;&gt;&gt; for word in words:
  ...     frequencies[word] += 1
  ... 
  &gt;&gt;&gt; print frequencies
  defaultdict(&lt;type 'int'&gt;, {'not': 1, 'to': 2, 'or': 1, 'be': 2})
  </code></pre>
  
  <p>So ideally in C# I could write:</p>
  
  <pre><code>var frequencies = new DefaultDictionary&lt;string,int&gt;(() =&gt; 0);
  foreach(string word in words)
  {
      frequencies[word] += 1
  }
  </code></pre>