Display missing values of specific column based on another specific column
<p>this is my problem</p>

<p>Let's say I have 2 columns on the dataframe which look like this:</p>

<pre><code> Type   | Killed
_______ |________
 Dog        1
 Dog       nan
 Dog       nan
 Cat        4
 Cat       nan
 Cow        1
 Cow       nan
</code></pre>

<p>I would like to display all missing value in Killed according to the Type and count them</p>

<p>My desire outcome would look something like this:</p>

<pre><code>Type | Sum(isnull)
Dog       2
Cat       1
Cow       1
</code></pre>

<p>Is there anyway to display this?</p>

<p>I can get you both <code>isnull</code> and <code>notnull</code></p>

<pre><code>isnull = np.where(df.Killed.isnull(), 'isnull', 'notnull')
df.groupby([df.Type, isnull]).size().unstack()
</code></pre>

<p><a href="http://i.stack.imgur.com/qkD6N.png" rel="nofollow"><img src="http://i.stack.imgur.com/qkD6N.png" alt="enter image description here"></a></p>

python pandas dataframe multiple-columns