title: Pandas sample with weights
body: <p>I have <code>df</code> and I'd like to make some sampling from it with respect to distribution of some variable. Let's say <code>df['type'].value_counts(normalize=True)</code> returns:</p>
  <pre><code>A 0.3
  B 0.5
  C 0.2
  </code></pre>
  <p>I'd like to make something like <code>sampledf = df.sample(weights=df['type'].value_counts(normalize=True))</code> such that <code>sampledf ['type'].value_counts(normalize=True)</code> will return almost the same distridution. How to pass dict with frequency here?</p>