title: how to filter out rows in data frame and take the sum
body: <p>I am new to pandas
  I have a dataframe and it has three columns with values as</p>
  
  <pre><code>nTimeStamp       nMessageCode   nIOC
  1544114048       12073           0
  1544114048       12075           0         
  1544114048       12073           1
  1544114048       12075           1
  1544114049       12074           0         
  1544114049       12073           0
  1544114049       12075           0
  </code></pre>
  
  <p>I want to get the sum as per the nTimeStamp based on the filter as below</p>
  
  <p>SQL code </p>
  
  <pre><code>SELect nTimeStamp, SUM(nFilter) nCount
   FROM (
  Select nTimeStamp case when nMessageCode in (12073,12074)
                         then 1
                         when nMessageCode = 12075 and nIOC = 0
                         then 1
                         else 0
                     end 'nFilter'   
        )
   group by nTimeStamp
  </code></pre>
  
  <p>expected result will be </p>
  
  <pre><code>nTimestamp       nCount
  1544114048         3
  1544114049         3
  </code></pre>
  
  <p>How do I achieve the same. Please help</p>