title: How to get Python to add a new row in excel every time I run the program?
body: <p>I have a function thats collects data from a sandbox api, and writes this data into a ecxel sheet using pandas and xlsxwriter combinded. My question is how I can get Python to write the new data into a new row every time I run the program? Now it's just overwriting the old data every time i run the program over again.</p>
  <p>This is my code:</p>
  <pre><code>import pandas as pd
  import xlsxwriter
  import requests
  
  def collection():
  api_url = f'https://sandbox.millistream.com/mws.fcgi?usr=sandbox&amp;pwd=sandbox&amp;cmd=quote&amp;list=39970\
  &amp;fields=symbol,name,diff1dprc,lastprice,time&amp;orderby=symbol&amp;order=asc&amp;timezone=Europe/Oslo&amp;filetype=json'
  data = requests.get(api_url).json()
  
  my_columns = ['Time', 'Stocks price']
  final_dataframe = pd.DataFrame(columns=my_columns)
  
  final_dataframe = final_dataframe.append(
      pd.Series(
          [
              data[2]['time'],
              data[2]['lastprice']
          ],
          index=my_columns),
      ignore_index=True
  )
  
  writer = pd.ExcelWriter('Testing.xlsx', engine='xlsxwriter')
  final_dataframe.to_excel(writer, 'AKER', index=False)
  
  background_color = '#000000'
  font_color = '#E8130F'
  
  string_format = writer.book.add_format(
  {
  'font_color': font_color,
  'bg_color': background_color,
  'border': 1
  }
  )
  dollar_format = writer.book.add_format(
  {
  'num_format': '$0.00',
  'font_color': font_color,
  'bg_color': background_color,
  'border': 1
  }
  )
  
  writer.sheets['AKER'].set_column('A1:A506', 20, string_format)
  writer.sheets['AKER'].set_column('B1:B506', 10, dollar_format)
  writer.save()
  </code></pre>
  <p>This is the return in Excel:
  <img src="https://i.stack.imgur.com/2fmzW.png" alt="Output" /></p>
  <p>And this is how I want the return to look:
  <img src="https://i.stack.imgur.com/dERUU.png" alt="Expected output" /></p>