title: Python: To group records by date and severity
body: <p>I have a csv having columns alarm-time, Severity, alarm-title, Node_Name, alarm-number. I want to use dataframe and group the records datewise, count of Issuenames (records) under each severity</p>
  
  <p>Sample Input Data in (CSV):</p>
  
  <pre><code>serial-number   tool-id  node-name  node-type   alarm-time  severity alarm-num
  26977497          1001    nlsdp14   emm         09-12-18 11:00  P3    3504
  26972088          1001    nlsdp15   SDP         09-12-18 11:59  P4    1230
  26972087          1001    nlsdp16   SDP         09-12-18 22:59  P4    1230
  26968481          1002    nlsdp17   emm         10-12-18 23:59  P3    1230
  26965776          1003    nlsdp18   SDP         11-12-18 23:59  P2    1230
  26963071          1004    nlsdp19   SDP         12-12-18 21:59  P3    1230
  26960366          1005    nlsdp20   emm         13-12-18 20:59  P1    1230
  26957661          1006    nlsdp21   SDP         14-12-18 11:59  P2    1230
  26954956          1007    nlsdp22   SDP         15-12-18 23:59  P4    1230
  26952251         1008     nlsdp23   emm         16-12-18 10:59  P5    1230
  </code></pre>
  
  <p>I was able to get the output, but the severity is getting displayed in rows</p>
  
  <p>All I need is to get displayed in another format.</p>
  
  <pre><code>file = r'C:\Rajhesh\Python Exercise\Training\week49.csv'
  
  df = pd.read_csv(file, usecols = ['serial-number', 'node-name',
         'node-ip', 'node-type', 'alarm-time',
         'severity', 'alarm-number','alarm-title'],
          parse_dates =['alarm-time'],
          index_col=['alarm-time'])
  
  df.groupby('severity').resample('D').count()
  
  severity    alarm-time  serial-number   node-name   node-ip node-type   severity    alarm-number    alarm-title
  P1  03-12-18    258 256 258 258 258 258 258
      04-12-18    198 188 198 198 198 198 198
      05-12-18    356 356 356 356 356 356 356
      06-12-18    446 446 446 446 446 446 446
      07-12-18    368 368 368 368 368 368 368
      08-12-18    431 431 431 431 431 431 431
      09-12-18    381 381 381 381 381 381 381
  P2  03-12-18    77201   76563   77201   77201   77201   77201   77201
      04-12-18    78915   78283   78915   78915   78915   78915   78915
      05-12-18    83061   82412   83061   83061   83061   83061   83061
      06-12-18    92513   91861   92513   92513   92513   92513   92513
      07-12-18    91735   91096   91735   91735   91735   91735   91735
      08-12-18    90027   89431   90027   90027   90027   90027   90027
      09-12-18    87532   86982   87532   87532   87532   87532   87532
  P3  03-12-18    21338   21338   21338   20696   21338   21338   21334
      04-12-18    21495   21495   21495   20895   21495   21495   21492
      05-12-18    20479   20479   20479   19821   20479   20479   20476
      06-12-18    20807   20807   20807   19883   20807   20807   20807
      07-12-18    20671   20670   20671   19697   20671   20671   20668
      08-12-18    20859   20859   20859   20216   20859   20859   20857
      09-12-18    21128   21128   21128   20664   21128   21128   21128
  P4  03-12-18    27012   26316   27012   27012   27012   27012   27012
      04-12-18    28294   27573   28294   28294   28294   28294   28294
  
  ------------------------------------------------------------------------------
  </code></pre>
  
  <p>But I need the output as :</p>
  
  <pre><code>alarm-time  P1  P2  P3  P4
  03-12-18    258 77201   21338   27012
  04-12-18    198 78915   21495   28294
  05-12-18    356 83061   20479   
  06-12-18    446 92513   20807   
  07-12-18    368 91735   20671   
  08-12-18    431 90027   20859   
  09-12-18    381 87532   21128   
  </code></pre>
  
  <hr>
  
  <p>Also, if possible kindly share me some useful links / docs, where I can have multiple examples over Groupby, sorting and aggregation, so that I can have a better understanding</p>