title: Python pandas dataframe: find max for each unique values of an another column
body: <p>I have a large dataframe (from 500k to 1M rows) which contains for example these 3 numeric columns: ID, A, B</p>
  <p>I want to filter the results in order to obtain a table like the one in the image below, where, for each unique value of column id, i have the maximum and minimum value of A and B.
  How can i do?</p>
  <p>EDIT: i have updated the image below in order to be more clear: when i get the max or min from a column i need to get also the data associated to it of the others columns</p>
  <p><a href="https://i.stack.imgur.com/xuinR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xuinR.png" alt="enter image description here" /></a></p>