title: Calculating difference between various dates and results for each different date
body: <p>Good day all,</p>
  <p>I have various dates and then each date has test results.</p>
  <p>Ie: date 1: result = 5
  Date 2: result = 12 etc…</p>
  <p>How do I compare the dates and results in python:
  (current date - previous date) / (current result - prev result)</p>
  <p>Keeping in mind I have at times 20 columns with different dates and results.</p>
  <p>More info:</p>
  <pre><code>Df = pd.DataFrame{‘dates’: [date1, date2, date3, date4],
  </code></pre>
  <p>‘results’: [5,9,0,4]
  }</p>
  <p>To do the trend I will use the followinng formula:</p>
  <p>Current result - prev result / current date - prev date</p>
  <p>(9-5)/(date2-date1)
  Get result
  Then</p>
  <p>(4-0)/(date4-date3)
  Get result. Then trend all the results on a line plot.</p>
  <p>I am able to do this for 2 dates, but have multiple dates with multiple results. In excel i do the calculation, but I would like to automate this. Just load dataset into pandas and  script does all the calculations.</p>