iode.Variables
- class iode.Variables
IODE Variables database.
- Parameters:
- filepath: str, optional
file containing the IODE variables to load.
- Returns:
- Variables
Examples
>>> from iode import variables, SAMPLE_DATA_DIR >>> variables.load(f"{SAMPLE_DATA_DIR}/fun.var") >>> len(variables) 394 >>> variables Workspace: Variables nb variables: 394 filename: ...\tests\data\fun.var description: Modèle fun - Simulation 1 sample: 1960Y1:2015Y1 mode: LEVEL name 1960Y1 1961Y1 1962Y1 1963Y1 1964Y1 1965Y1 ... 2009Y1 2010Y1 2011Y1 2012Y1 2013Y1 2014Y1 2015Y1 ACAF na na na na na na ... -37.46 -37.83 -44.54 -55.56 -68.89 -83.34 -96.41 ACAG na na na na na na ... 27.23 28.25 29.28 30.32 31.37 32.42 33.47 AOUC na 0.25 0.25 0.26 0.28 0.29 ... 1.29 1.31 1.33 1.36 1.39 1.42 1.46 AOUC_ na na na na na na ... 1.23 1.25 1.27 1.30 1.34 1.37 1.41 AQC 0.22 0.22 0.22 0.23 0.24 0.25 ... 1.45 1.46 1.48 1.51 1.56 1.61 1.67 ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ZJ na na na na na na ... 1.49 1.51 1.53 1.56 1.59 1.63 1.67 ZKF 0.80 0.81 0.82 0.81 0.83 0.82 ... 0.87 0.87 0.87 0.87 0.87 0.87 0.87 ZKFO 1.00 1.00 1.00 1.00 1.00 1.00 ... 1.02 1.02 1.02 1.02 1.02 1.02 1.02 ZX 0.00 0.00 0.00 0.00 0.00 0.00 ... 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ZZF_ 0.69 0.69 0.69 0.69 0.69 0.69 ... 0.69 0.69 0.69 0.69 0.69 0.69 0.69
- Attributes:
- filename: str
- description: str
- mode: int
- sample: Sample
- nb_periods: int
- periods: list(str)
- periods_as_float: list(float)
Methods
clear(self)Delete all objects from the current database.
copy(self)Create a copy of an IODE database.
copy_from(self, input_files[, objects_names])Copy (a subset of) objects from the input file(s) 'input_files' into the current database.
extrapolate(self, method[, from_period, ...])Extrapolate variables using one the method described below, based on previous periods.
from_array(self, array[, time_axis_name, sep])Copies the Array array into the IODE Variables database.
from_frame(self, df)Copy the pandas DataFrame df into the IODE Variables database.
get_names(self[, pattern])Returns the list of objects names given a pattern.
high_to_low(self, type_of_series, filepath, ...)Build series of lower periodicity by (summing the / taking the average of the / taking the last observation of) sub-periods.
is_copy_subset(self)Whether or not the present object represents of a subset of a global IODE database and if the IODE objects of the subset represent deep copies of the IODE objects from the global IODE database.
is_subset(self)Whether or not the present object represents a subset of a global IODE database.
load(self, filepath)Load objects stored in file 'filepath' into the current database.
low_to_high(self, type_of_series, method, ...)Build series with higher periodicity for stock data (Unemployment, Debt, ...) or flow data (GNP, Deficit, ...).
merge(self, other[, overwrite])merge_from(self, input_file)Merge all objects stored in the input file 'input_file' into the current database.
periods_subset(self[, from_period, ...])Return a subset of the periods from the current Variables sample.
remove(self, names)Delete the object(s) named 'names' from the current database.
rename(self, old_name, new_name)Rename an object of the database.
save(self, filepath)Save objects of the current database into the file 'filepath'.
search(self, pattern[, word, ...])Return a list of all objects from the current database having a specific pattern in their names or LEC expression, comment...
seasonal_adjustment(self, input_file[, ...])Eliminate seasonal variations in monthly series (= variables).
to_array(self[, vars_axis_name, ...])Creates an Array from the current IODE Variables database.
to_frame(self[, vars_axis_name, ...])Create a pandas DataFrame from the current Variables database.
trend_correction(self, input_file, lambda_)Implementation of the Hodrick-Prescott method for trend series (= variables) construction.
- __init__(*args, **kwargs)
Methods
__init__(*args, **kwargs)clear(self)Delete all objects from the current database.
copy(self)Create a copy of an IODE database.
copy_from(self, input_files[, objects_names])Copy (a subset of) objects from the input file(s) 'input_files' into the current database.
extrapolate(self, method[, from_period, ...])Extrapolate variables using one the method described below, based on previous periods.
from_array(self, array[, time_axis_name, sep])Copies the Array array into the IODE Variables database.
from_frame(self, df)Copy the pandas DataFrame df into the IODE Variables database.
get_names(self[, pattern])Returns the list of objects names given a pattern.
high_to_low(self, type_of_series, filepath, ...)Build series of lower periodicity by (summing the / taking the average of the / taking the last observation of) sub-periods.
is_copy_subset(self)Whether or not the present object represents of a subset of a global IODE database and if the IODE objects of the subset represent deep copies of the IODE objects from the global IODE database.
is_subset(self)Whether or not the present object represents a subset of a global IODE database.
load(self, filepath)Load objects stored in file 'filepath' into the current database.
low_to_high(self, type_of_series, method, ...)Build series with higher periodicity for stock data (Unemployment, Debt, ...) or flow data (GNP, Deficit, ...).
merge(self, other[, overwrite])merge_from(self, input_file)Merge all objects stored in the input file 'input_file' into the current database.
periods_subset(self[, from_period, ...])Return a subset of the periods from the current Variables sample.
remove(self, names)Delete the object(s) named 'names' from the current database.
rename(self, old_name, new_name)Rename an object of the database.
save(self, filepath)Save objects of the current database into the file 'filepath'.
search(self, pattern[, word, ...])Return a list of all objects from the current database having a specific pattern in their names or LEC expression, comment...
seasonal_adjustment(self, input_file[, ...])Eliminate seasonal variations in monthly series (= variables).
to_array(self[, vars_axis_name, ...])Creates an Array from the current IODE Variables database.
to_frame(self[, vars_axis_name, ...])Create a pandas DataFrame from the current Variables database.
trend_correction(self, input_file, lambda_)Implementation of the Hodrick-Prescott method for trend series (= variables) construction.
Attributes
descriptiondescription: str
df: DataFrame
filenamefilename: str
mode: str
namesnames: List[str]
nb_periods: int
periods: List[str]
periods_as_float: List[float]
sample: Sample