iode.ComputedTable

class iode.ComputedTable[source]

Object returned by the method compute(). It represents the computation of an IODE table given a generalized sample.

Attributes:
columns

List of column names of the computed table.

files

The list of files associated with the computed table.

graph_alignment

Graph alignment of the table.

graph_axis

Graph axis of the table allows you to select the type of axis:

gridx

The gridx value of the table offers a choice of three X-grid options:

gridy

The gridy value of the table offers a choice of three Y-grid options:

lines

List of line names of the computed table.

nb_columns

The number of columns of the computed table.

nb_decimals

The number of decimals used for rounding the values when displayed.

nb_files

The number of files used to compute the table.

nb_lines

The number of lines of the computed table.

nb_operations_between_files

The number of operations between files.

nb_periods

The number of periods associated with the computed table.

plot_data

Returns a dictionary containing the data to be plotted.

sample

The sample associated with the computed table.

title

The title of the computed table.

ymax

Maximum values on the Y axis.

ymin

Minimum values on the Y axis.

Methods

is_editable(row, column)

Check if a cell in the computed table is editable.

plot([title, plot_type, grid, y_log, y_min, ...])

Plot the computed table.

print_to_file(destination_file[, format])

Print the present computed table to a file.

to_array()

Convert the computed table to a larray Array.

to_frame()

Convert the computed table to a pandas DataFrame.

from_cython_obj

Examples

>>> from iode import SAMPLE_DATA_DIR
>>> from iode import Table, tables, variables
>>> tables.load(f"{SAMPLE_DATA_DIR}/fun.tbl")
Loading .../fun.tbl
46 objects loaded 
>>> variables.load(f"{SAMPLE_DATA_DIR}/fun.var")
Loading .../fun.var
394 objects loaded
>>> tables["C8_1"]
DIVIS | 1                                  |
TITLE |      "Déterminants de l'output potentiel"
----- | ---------------------------------------------
CELL  |                                    |   "#s"
----- | ---------------------------------------------
CELL  | "Output potentiel"                 |  Q_F+Q_I
CELL  | "Stock de capital"                 | KNFF[-1]
CELL  | "Intensité de capital"             |    KLFHP
CELL  | "Productivité totale des facteurs" |  TFPFHP_

nb lines: 8
nb columns: 2
language: 'ENGLISH'
gridx: 'MAJOR'
gridy: 'MAJOR'
graph_axis: 'VALUES'
graph_alignment: 'LEFT'

>>> # simple time series (current workspace) - 6 observations - 4 decimals
>>> computed_table = tables["C8_1"].compute("2000:6", nb_decimals=4)
>>> computed_table
   line title \ period[file]     |     00    |     01    |     02    |     03    |     04    |     05
---------------------------------------------------------------------------------------------------------
Output potentiel                 | 5495.2128 | 5627.8589 | 5748.7804 | 5857.9529 | 5966.1999 | 6103.6318
Stock de capital                 | 8083.5517 | 8359.8908 | 8647.9354 | 8910.3393 | 9175.8106 | 9468.8865
Intensité de capital             |    0.5032 |    0.4896 |    0.4758 |    0.4623 |    0.4481 |    0.4349
Productivité totale des facteurs |    0.9938 |    1.0037 |    1.0137 |    1.0239 |    1.0341 |    1.0445
        
>>> # two time series (current workspace) - 5 observations - 2 decimals
>>> computed_table = tables["C8_1"].compute("(2010;2010/2009):5")
>>> computed_table
   line title \ period[file]     |    10    | 10/09 |    11    | 11/10 |    12    | 12/11 |    13    | 13/12 |    14    | 14/13
--------------------------------------------------------------------------------------------------------------------------------
Output potentiel                 |  6936.11 |  1.74 |  7045.34 |  1.57 |  7161.54 |  1.65 |  7302.29 |  1.97 |  7460.12 |  2.16
Stock de capital                 | 11293.85 |  2.82 | 11525.01 |  2.05 | 11736.78 |  1.84 | 11975.49 |  2.03 | 12263.95 |  2.41
Intensité de capital             |     0.39 | -2.17 |     0.38 | -2.05 |     0.37 | -1.91 |     0.36 | -1.86 |     0.36 | -1.90
Productivité totale des facteurs |     1.10 |  1.00 |     1.11 |  1.00 |     1.12 |  1.00 |     1.13 |  1.00 |     1.14 |  1.00

>>> # simple time series (current workspace + one extra file) - 5 observations - 2 decimals
>>> computed_table = tables["C8_1"].compute("2010[1;2]:5", extra_files=f"{SAMPLE_DATA_DIR}/ref.av")
>>> computed_table
   line title \ period[file]     |  10[1]   |  10[2]   |  11[1]   |  11[2]   |  12[1]   |  12[2]   |  13[1]   |  13[2]   |  14[1]   |  14[2]    
----------------------------------------------------------------------------------------------------------------------------------------------- 
Output potentiel                 |  6936.11 |  6797.39 |  7045.34 |  6904.44 |  7161.54 |  7018.31 |  7302.29 |  7156.24 |  7460.12 |  7310.91  
Stock de capital                 | 11293.85 | 11067.97 | 11525.01 | 11294.51 | 11736.78 | 11502.05 | 11975.49 | 11735.98 | 12263.95 | 12018.67  
Intensité de capital             |     0.39 |     0.38 |     0.38 |     0.37 |     0.37 |     0.36 |     0.36 |     0.36 |     0.36 |     0.35  
Productivité totale des facteurs |     1.10 |     1.08 |     1.11 |     1.09 |     1.12 |     1.10 |     1.13 |     1.11 |     1.14 |     1.12  
>>> # multiple patterns (current workspace + 1 extra file) - 6 observations - 2 decimals (default)
>>> extra_files = f"{SAMPLE_DATA_DIR}/ref.av"
>>> generalized_sample = "2000;2002;2004//2003;2006[1;2];2008[1+2];2010/2009[1^2]"
>>> computed_table = tables["C8_1"].compute(generalized_sample, extra_files)
>>> computed_table
    line title \ period[file]     |  00[1]  |  02[1]  | 04//03[1] |  06[1]  |  06[2]  | 08[1+2]  | 10/09[1^2]
-------------------------------------------------------------------------------------------------------------
Output potentiel                 | 5495.21 | 5748.78 |      1.85 | 6275.47 | 6149.96 | 13177.88 |       1.74
Stock de capital                 | 8083.55 | 8647.94 |      2.98 | 9822.45 | 9626.00 | 21009.68 |       2.82
Intensité de capital             |    0.50 |    0.48 |     -3.07 |    0.42 |    0.41 |     0.80 |      -2.17
Productivité totale des facteurs |    0.99 |    1.01 |      1.00 |    1.05 |    1.03 |     2.13 |       1.00
__init__()[source]

Methods

__init__()

from_cython_obj(obj)

is_editable(row, column)

Check if a cell in the computed table is editable.

plot([title, plot_type, grid, y_log, y_min, ...])

Plot the computed table.

print_to_file(destination_file[, format])

Print the present computed table to a file.

to_array()

Convert the computed table to a larray Array.

to_frame()

Convert the computed table to a pandas DataFrame.

Attributes

columns

List of column names of the computed table.

files

The list of files associated with the computed table.

graph_alignment

Graph alignment of the table.

graph_axis

Graph axis of the table allows you to select the type of axis:

gridx

The gridx value of the table offers a choice of three X-grid options:

gridy

The gridy value of the table offers a choice of three Y-grid options:

lines

List of line names of the computed table.

nb_columns

The number of columns of the computed table.

nb_decimals

The number of decimals used for rounding the values when displayed.

nb_files

The number of files used to compute the table.

nb_lines

The number of lines of the computed table.

nb_operations_between_files

The number of operations between files.

nb_periods

The number of periods associated with the computed table.

plot_data

Returns a dictionary containing the data to be plotted.

sample

The sample associated with the computed table.

title

The title of the computed table.

ymax

Maximum values on the Y axis.

ymin

Minimum values on the Y axis.