title: “first” and “last” functions to columns while using group by in pandas fails
body: <p>I tried to implement the solution provided <a href="https://stackoverflow.com/questions/15001237/how-to-apply-first-and-last-functions-to-columns-while-using-group-by-in-pan">here</a> and I am getting "invalid syntax"
  I am trying to get the max value + firs/last value.</p>
  
  <p>and my code looks like this:</p>
  
  <pre><code>groups = df[df['isTrade'] == 1].groupby('dateTime_s')                         
  print(groups.agg({
        'Volume': np.sum,
        'tradePrice':[np.max,lambda x: x.iloc[0]], 
        }).head(160))
  </code></pre>
  
  <p>Thanks for your help!</p>