I'm new to Python, but have successfully pulled Eikon data and used in PowerBI. I'm attempting to pull data changes between two periods, and I'm able to do so in Python via diff, but when loading in Python lose the Timestamp (I get the difference in days, as diff seems to give change in the data I care about and the days):
from datetime import date, timedelta
import pandas as pd
import eikon as ek
ek.set_app_key('MY APP KEY')
stocks = ek.get_timeseries('DST-STK-T-EIA',
fields=['Close','Timestamp'],
start_date=(date.today()-timedelta(days=(13*365))).strftime("%Y-%m-%d"),
end_date=(date.today()+timedelta(days=(5*365))).strftime("%Y-%m-%d"),interval="weekly"
)
stocks['Timestamp'] = stocks.index
stocks_change = stocks.diff()