I have a list of over 800 bond ISIN and I am using ld.get_data() in a loop to download historical pricing data in chunks (see attached txt file). I need a solution to handle cases where no data is available, so that no errors are returned.
First isin chunk: ['ES0200002022', 'IT0005057770', 'US00289WAA99', 'USE00020AA01', 'JP376280AG96', 'JP525003CH18', 'JP525003DH17', 'XS1242327325', 'NO0010720972', 'XS1238024035', 'AT0000A191A9', 'AT0000A1MC22', 'AT0000A1MC30', 'LV0000801777', 'XS1242327168', 'NO0010723265', 'NO0010723257', 'XS1140300663', 'INE336K07016', 'INE336K07024', 'INE336K07032', 'XS1263846617', 'NO0010790769', 'TW000B718907', 'XS1113024563']
Isin chunk example with problems: ['LT0000404238', 'ES0200002055', 'PTEDPLOM0017', 'US75975AAA88', 'XS2104995399', 'NO0010872948', 'USY7279WAA90', 'USA35155AD17', 'XS2095992017', 'NO0010874050', 'XS2082429890', 'XS2123970167', 'PLCFRPT00054', 'INE316W07013', 'XS2110675860', 'XS2127478316', 'US209111FX66', 'US209111FY40', 'US67021CAP23', 'US032654AS42', 'US05351WAC73', 'US744448CU39', 'FR0013515707', 'NO0010881337', 'USU1851TAC54']
My issue are the following error messages that appear for some ISIN when there seems to be no data avilable while for other just an empty row is returned. See errors below, after the code ran for a few rounds. I know that also the first chunks contain ISIN for which data is not available but for some reason the code can handle them there. I have implemented to remove those ISIN from the code and try again but this takes very long. Maybe someone has a better solution?
Here I tried downloading prices for one ISIN of a chunk that runs without error in the loop, but now giving errors:
How it is supposed to look:
In a previous version I used rdp.get_data() and I did not have issues with empty ISIN. So I do not understand what changed with ld.get_data() ?
Thanks!