title: How to calculate maximum from pivot table in python
body: <p>I have written code to calculate the count of feature3 groupby feature1 and feature2</p>
  
  <pre><code>pd.pivot_table(data=train, index=['feature1', 'feature2'], values=['feature3'], aggfunc='count')
  </code></pre>
  
  <p>Who's output is:</p>
  
  <pre><code>feature1 feature2 feature3  
  129001  0   4
          1   10
          2   11
          3   22
          4   26
          5   38
  129002  0   6
          2   45
          5   25
  </code></pre>
  
  <p>Now I want to calculate max of feature3 groupby feature1</p>
  
  <pre><code>feature1 feature3
  129001    38
  129002    45
  </code></pre>