How to display a row based on specific columns and values
<p>Let's say I have this dataframe:</p>

<pre><code>Type    |    Killed
Dog            5
Cat            7
Dog            9
Dog           10
Dog            6
Cat            2
Cow            1
</code></pre>

<p>I would like to display the row where the number of dogs killed is more than 7.</p>

<p>My desired outcome would be:</p>

<pre><code>Type    |    Killed
Dog            9
Dog           10
</code></pre>

<p>Thank you!</p>

<p>You can select data using:</p>

<pre><code>data[(data.Type == 'Dog') &amp; (data.Killed &gt; 7)]
</code></pre>

<p><strong>Example:</strong></p>

<pre><code>import pandas as pd

Type=['Dog','Cat','Dog','Dog','Dog','Cat','Cow']
Killed=[5,7,9,10,6,2,1]

dataset=zip(Type,Killed)

data=pd.DataFrame(dataset)

data.columns=['Type','Killed']
data.loc[((data.Type == 'Dog') &amp; data['Killed'] &gt; 7) ]
</code></pre>

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

python pandas