title: Using value_counts in pandas with conditions
body: <p>I have a column with around 20k values. I've used the following function in pandas to display their counts:</p>
  <pre><code>weather_data[&quot;snowfall&quot;].value_counts()
  </code></pre>
  <p><code>weather_data</code> is the dataframe and <code>snowfall</code> is the column.</p>
  <p>My results are:</p>
  <pre><code>0.0     12683
  M       7224
  T       311
  0.2     32
  0.1     31
  0.5     20
  0.3     18
  1.0     14
  0.4     13
  </code></pre>
  <p>etc.</p>
  <p>Is there a way to:</p>
  <ol>
  <li><p>Display the counts of only a single variable or number</p>
  </li>
  <li><p>Use an if condition to display the counts of only those values which satisfy the condition?</p>
  </li>
  </ol>