For the following code, how to I set the end date as today and the start date as one year previous? I would like the formula to be dynamic so that I can run this daily and it always generates the request for the trailing previous year.
df, e = ek.get_data(['AEFS.L'],
['TR.RNSFilerName',
'TR.RNSAnnouncedDate',
'TR.RNSTransactionType',
'TR.RNSARNumShrsTransacted',
'TR.RNSARPctOSTransacted',
'TR.RNSARTransactionPrice',
'TR.RNSARMktValTransaction',
'TR.RNSARTotShrsPostTrans',
'TR.RNSARPctOSPostTrans'])
start_date = '2019-01-31'
end_date = '2020-01-31'
df['RNS Announced Date'] = pd.to_datetime(df['RNS Announced Date'])mask = (df['RNS Announced Date'] > start_date) & (df['RNS Announced Date'] <= end_date)
df = df.loc[mask]
df