title: Pandas finding local max and min
body: <p>I have a pandas data frame with two columns one is temperature the other is time. </p>
  
  <p>I would like to make third and fourth columns called min and max. Each of these columns would be filled with nan's except where there is a local min or max, then it would have the value of that extrema.  </p>
  
  <p>Here is a sample of what the data looks like, essentially I am trying to identify all the peaks and low points in the figure. </p>
  
  <p><a href="https://i.stack.imgur.com/8Qu0y.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/8Qu0y.jpg" alt="enter image description here"></a></p>
  
  <p>Are there any built in tools with pandas that can accomplish this?</p>