title: How to remove duplicate entries but keep the first row selected columns value and last row selected columns value?
body: <p>I'm creating the charts in periscopedata and doing pandas to derive our results. I'm facing difficulties when removing duplicates from the results.  </p>
  
  <p>This is our data look like in final dataframe after calculating. </p>
  
  <pre><code>vendor_ID date        opening purchase paid closing
  B2345     01/01/2015  5       20       10   15
  B2345     01/01/2015  15      50       20   45
  B2345     02/01/2015  45      4        30   19
  
  </code></pre>
  
  <p>I want to remove the duplicate entry based on vendor_ID and date but keep the starting opening and keep the last entry closing</p>
  
  <p>i.e) Expected result I want </p>
  
  <pre><code>vendor_ID date        opening purchase paid closing
  B2345     01/01/2015  5       70       30   45
  B2345     02/01/2015  45      4        30   19
  </code></pre>
  
  <p>I've tried below code to remove the duplicates but that gave us different error. </p>
  
  <pre><code>df.drop_duplicates(subset=["vendor_ID", "date"], keep="last", inplace=True)
  </code></pre>
  
  <p>How do I code such way to remove the duplicates and keep the first and last as mentioned in above example.</p>