title: Checking NaN values in pandas dataframe with int8 columns
body: <p>As was proposed in a <a href="https://stackoverflow.com/questions/50877663/memory-efficient-way-to-store-bool-and-nan-values-in-pandas">question</a> I posed last week, a memory efficient way to store a column with values in the range <code>[True, False, NaN]</code> would be to use the <code>int8</code>-datatype to denote <code>True</code> as <code>1</code>, <code>False</code> as <code>0</code> and <code>NaN</code> as <code>-1</code>.</p>
  
  <p>If I do this, what would be good practice to "redefine" pandas' <code>isnull()</code> methods to also take into account that, if a column in a dataframe has dtype <code>int8</code>, <code>-1</code> should be considered a null-value. I could think of defining a new function <code>def isnull(v)</code>, that returns if a value is NaN, or -1 in case of dtype <code>int8</code>, but I can imagine this will not be a very fast and efficient solution (given that the dataframe I am working with is multiple gigabytes big, and I want to be able to count the amount of "null"-values in a column/dataframe). </p>