Commit a95329e1 authored by Dóra Kocsis's avatar Dóra Kocsis
Browse files

cosmetics

parent db439cff
......@@ -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)
......
% 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
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment