title: Random DataFrame sample with at least 1 unique value of a column
body: <p>I want to randomly sample my Dataframe but in the sample there should be at least 1 unique value of a specific column: </p>
  
  <p>The dataset has a column: "Month" which is a numeric value from 1 to 12; I'd like to have at least one row for each month in my random sample.</p>
  
  <p>This is what I'm using to sample:</p>
  
  <pre class="lang-py prettyprint-override"><code>df = df.sample(frac=0.2, replace=True, random_state=1)
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>Applying Quang Hoang answer seems working:
  the initial <code>df.count()</code> gives me <strong>864806</strong> rows, after applying the function it goes to <strong>172956</strong> and if I do <code>df['month'].unique()</code> I get:</p>
  
  <pre><code>array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12])
  </code></pre>
  
  <p>Is there a pandas builtin method to do the same?</p>