fetch_series_by_api_link.m
- document better in header (what goes in
varargin) - line 21: if
series_listis empty, setdf={};thenreturn. Otherwise the rest of the code is indented as you have it now... - line 30:
length(dataset_codes) - example in header doesn't work:
fetch_series_by_api_link("https://api.db.nomics.world/v22/series?provider_code=AMECO&dataset_code=ZUTN") - this function is very slow. It took 10 seconds to run
fetch_series_by_api_link("https://api.db.nomics.world/v22/series/BIS/long_pp?limit=1000&offset=0&q=&observations=1&align_periods=1&dimensions=%7B%7D")on my computer. It seems like the bulk of the time is spent in the loop starting on line 109. On first look, you don't need to go through this cell by cell, rather column by column, avoiding the inner loop. You should also be able to assign the first row in one line asordered_columns_nameswill be a cell array of strings once #8 (closed) is done, removing the loop on lines 56-60. You may want to initializedftoNaNas well.... anyway, we'll review all of this once #8 (closed) is done.
Edited by Houtan Bastani