title: pivot table in pandas with multiple columns
body: <p>I have following dataframe in pandas</p>
  
  <pre><code>  date        prod    hourly_bucket      tank      trans      flag     
    01-01-2019  TP      05:00:00-06:00:00  2         Preset     Peak
    01-01-2019  TP      05:00:00-06:00:00  2         Preset     Peak
    01-01-2019  TP      05:00:00-06:00:00  2         Non Preset Peak
    02-01-2019  TP      05:00:00-06:00:00  2         Preset     Lean
    02-01-2019  TP      05:00:00-06:00:00  2         Preset     Lean
    02-01-2019  TP      05:00:00-06:00:00  2         Non Preset Lean
  </code></pre>
  
  <p>My Desired dataframe would be aggregation at day level and tank level and then taking a count of how many <code>Preset,Non-Preset</code> transactions in <code>Lean and Peak</code> hours</p>
  
  <pre><code>  date       tank   Lean_Non_Preset  Lean_Preset  Peak_Non_Preset  Peak_Preset
    01-01-2019 2      1                2            1                2
  </code></pre>
  
  <p>I am doing following in pandas</p>
  
  <pre><code> lean_peak_preset_cnt = df.pivot_table(index=['date','tank'], columns=['flag'],values=['trans'],aggfunc='count').reset_index()  
  </code></pre>
  
  <p>But it does not give me the required solution</p>