title: Pandas: category dtype and filter
body: <p>using pandas 0.18.1, I realized a different behavior when filtering a column whose <code>dtype</code> is <code>category</code>. Here is a minimal example.</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  l = np.random.randint(1, 4, 50)
  df = pd.DataFrame(dict(c_type=l, i_type=l))
  df['c_type'] = df.c_type.astype('category')
  
  df.info()
  
  &lt;class 'pandas.core.frame.DataFrame'&gt;
  RangeIndex: 50 entries, 0 to 49
  Data columns (total 2 columns):
  c_type    50 non-null category
  i_type    50 non-null int64
  dtypes: category(1), int64(1)
  memory usage: 554.0 bytes
  </code></pre>
  
  <p>Filtering out one of the value of the integer type columns leads to</p>
  
  <pre><code>df[df.i_type.isin([1, 2])].i_type.value_counts()
  
  2    20
  1    17
  Name: i_type, dtype: int64
  </code></pre>
  
  <p>but the same filtering on the category type column keeps the value filtered as an entry</p>
  
  <pre><code>df[df.c_type.isin([1, 2])].c_type.value_counts()
  
  2    20
  1    17
  3     0
  Name: c_type, dtype: int64
  </code></pre>
  
  <p>Although the filter works, the behavior seems unusual to me. The filter could be used, for example, to exclude future columns from a <code>pivot_table</code> function which requires an extra filter when dealing with <code>category</code>. </p>
  
  <p>Is it an expected behavior?</p>