diff --git a/README.md b/README.md index 170750a4537ba1fa3d79bc15d017180b50ec4c3d..b7ba485c8a1992adc466b3d6b4a9bcb305a88f6e 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ This MATLAB toolbox comes with routines to access DBnomics time series from MATLAB. -The package is compatible with MATLAB 2019b and following versions. -Octave compability will follow after the release of Octave 6 (an implementation to webread/webwrite/jsondecode is required). +The package is compatible with MATLAB 2015a and following versions. +Octave compatibility will follow after the release of Octave 6 (an implementation to webread/webwrite/jsondecode is required). ## Installation @@ -47,17 +47,17 @@ The returned data is stored in the `df_id` variable. Its type is a cell array. T >> tab_id = cell2table(df_id(2:end,:), 'VariableNames', df_id(1,:)); >> tab_id(1:3,:) - - 3×16 table + + 3�16 table x_frequency provider_code dataset_code dataset_name series_code series_name original_period period original_value value freq unit geo Frequency Unit Country ___________ _____________ ____________ __________________________________________________________________ _____________________ ____________________________________________________________ _______________ ______________ ______________ _____ _____ ___________________________________ ________ ____________ _____________________________________ _____________ - {'annual'} {'AMECO'} {'ZUTN'} {'Unemployment rate: total :- Member States: definition EUROSTAT'} {'EA19.1.0.0.0.ZUTN'} {'Annually – (Percentage of active population) – Euro area'} {'1960'} {'1960-01-01'} {'NA'} NaN {'a'} {'percentage-of-active-population'} {'ea19'} {'Annually'} {'(Percentage of active population)'} {'Euro area'} - {'annual'} {'AMECO'} {'ZUTN'} {'Unemployment rate: total :- Member States: definition EUROSTAT'} {'EA19.1.0.0.0.ZUTN'} {'Annually – (Percentage of active population) – Euro area'} {'1961'} {'1961-01-01'} {'NA'} NaN {'a'} {'percentage-of-active-population'} {'ea19'} {'Annually'} {'(Percentage of active population)'} {'Euro area'} - {'annual'} {'AMECO'} {'ZUTN'} {'Unemployment rate: total :- Member States: definition EUROSTAT'} {'EA19.1.0.0.0.ZUTN'} {'Annually – (Percentage of active population) – Euro area'} {'1962'} {'1962-01-01'} {'NA'} NaN {'a'} {'percentage-of-active-population'} {'ea19'} {'Annually'} {'(Percentage of active population)'} {'Euro area'} - + {'annual'} {'AMECO'} {'ZUTN'} {'Unemployment rate: total :- Member States: definition EUROSTAT'} {'EA19.1.0.0.0.ZUTN'} {'Annually � (Percentage of active population) � Euro area'} {'1960'} {'1960-01-01'} {'NA'} NaN {'a'} {'percentage-of-active-population'} {'ea19'} {'Annually'} {'(Percentage of active population)'} {'Euro area'} + {'annual'} {'AMECO'} {'ZUTN'} {'Unemployment rate: total :- Member States: definition EUROSTAT'} {'EA19.1.0.0.0.ZUTN'} {'Annually � (Percentage of active population) � Euro area'} {'1961'} {'1961-01-01'} {'NA'} NaN {'a'} {'percentage-of-active-population'} {'ea19'} {'Annually'} {'(Percentage of active population)'} {'Euro area'} + {'annual'} {'AMECO'} {'ZUTN'} {'Unemployment rate: total :- Member States: definition EUROSTAT'} {'EA19.1.0.0.0.ZUTN'} {'Annually � (Percentage of active population) � Euro area'} {'1962'} {'1962-01-01'} {'NA'} NaN {'a'} {'percentage-of-active-population'} {'ea19'} {'Annually'} {'(Percentage of active population)'} {'Euro area'} + >> - + In such cell array, you will always find at least those columns: * `x_frequency`: (harmonized frequency generated by DBnomics) diff --git a/archive/template.m b/archive/template.m deleted file mode 100644 index 5e51621dd3262b59ac069799358184b2b8d28257..0000000000000000000000000000000000000000 --- a/archive/template.m +++ /dev/null @@ -1,54 +0,0 @@ -% fetch series by provider code and dataset code -test = fetch_series('provider_code', 'AMECO', 'dataset_code', 'UVGD', 'max_nb_series', 50); -ds = dbnomics_to_dseries(test); - -% fetch one series by ID -df_id = fetch_series('series_ids','AMECO/ZUTN/EA19.1.0.0.0.ZUTN'); -ds_id = dbnomics_to_dseries(df_id); - -% fetch multiple series by ID -df_ids = fetch_series('series_ids', {'AMECO/ZUTN/EA19.1.0.0.0.ZUTN', 'AMECO/ZUTN/DNK.1.0.0.0.ZUTN'}); -ds_ids = dbnomics_to_dseries(df_ids); - -% fetch many series by ID from different datasets -df_ids_sets = fetch_series('series_ids', {'AMECO/ZUTN/EA19.1.0.0.0.ZUTN', 'AMECO/ZUTN/DNK.1.0.0.0.ZUTN', 'IMF/CPI/A.AT.PCPIT_IX'}); -ds_ids_sets = dbnomics_to_dseries(df_ids_sets); - -% fetch time series by code mask -df_code_mask1 = fetch_series('provider_code', 'IMF', 'dataset_code', 'CPI', 'series_code', 'M.FR+DE.PCPIEC_IX+PCPIA_IX'); -ds_code_mask1 = dbnomics_to_dseries(df_code_mask1); - -df_code_mask2 = fetch_series('provider_code', 'IMF', 'dataset_code', 'CPI', 'series_code', '.FR.PCPIEC_WT'); -ds_code_mask2 = dbnomics_to_dseries(df_code_mask2); -% df_code_mask3 = fetch_series('provider_code', 'IMF', 'dataset_code', 'CPI', 'series_code', 'M..PCPIEC_IX+PCPIA_IX', 'max_nb_series', 400); - -% fetch series by dimensions -df_dim = fetch_series('provider_code','AMECO', 'dataset_code', 'ZUTN', 'dimensions', '{"geo":["dnk"]}'); -ds_dim = dbnomics_to_dseries(df_dim); - -df_dims = fetch_series('provider_code','WB','dataset_code','DB', 'dimensions', '{"country":["ES","FR","IT"],"indicator":["IC.REG.COST.PC.FE.ZS.DRFN"]}'); -ds_dims = dbnomics_to_dseries(df_dims); - -% fetch series by api link -df_link = fetch_series_by_api_link('https://api.db.nomics.world/v22/series/WB/DB?observations=1&dimensions=%7B%22country%22%3A%5B%22FR%22%2C%22IT%22%2C%22ES%22%5D%2C%22indicator%22%3A%5B%22IC.REG.COST.PC.FE.ZS.DRFN%22%5D%7D'); -ds_link = dbnomics_to_dseries(df_link); - -% fetch series from the cart -df_cart = fetch_series_by_api_link('https://api.db.nomics.world/v22/series?series_ids=AMECO%2FZUTN%2FEA19.1.0.0.0.ZUTN&observations=1'); -ds_cart = dbnomics_to_dseries(df_cart); - -% fetch multi frequency series -df_multi_freq = fetch_series('series_ids', {'BEA/NIUnderlyingDetail-U001BC/S315-A',... - 'BEA/NIUnderlyingDetail-U001BC/S315-Q',... - 'BEA/NIUnderlyingDetail-U001BC/S315-M'}); - -% fetch one series and apply interpolation filter -filters_ = '[{"code": "interpolate", "parameters": {"frequency": "monthly", "method": "spline"}}]'; -df_filter = fetch_series('series_ids', 'AMECO/ZUTN/EA19.1.0.0.0.ZUTN',... - 'dbnomics_filters', filters_); - -% fetch multiple series and apply interpolation filter -df_filters = fetch_series('series_ids', {'AMECO/ZUTN/EA19.1.0.0.0.ZUTN', 'AMECO/ZUTN/DNK.1.0.0.0.ZUTN'},... - 'dbnomics_filters', filters_); - - \ No newline at end of file diff --git a/src/fetch_series_by_api_link.m b/src/fetch_series_by_api_link.m index 88c3f24d1fa936104885b4e3374ad737e62224b1..d87f3f53c18effac35c0b09eec1b7624e53aec22 100644 --- a/src/fetch_series_by_api_link.m +++ b/src/fetch_series_by_api_link.m @@ -86,7 +86,6 @@ else series_list = [series_list, filtered_series_list]; end - %%%%%%% OPTIMIZE SIZE PRE-ALLOCATION %%%%%%% rows_ = 0; for s = 1:length(series_list) rows_ = rows_ + length(series_list{s}.value);