iode.ComputedTable.to_frame

ComputedTable.to_frame() DataFrame[source]

Convert the computed table to a pandas DataFrame.

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
>>> # simple time series (current workspace) - 6 observations
>>> computed_table = tables["C8_1"].compute("2000:6")
>>> computed_table
   line title \ period[file]     |    00   |    01   |    02   |    03   |    04   |    05
---------------------------------------------------------------------------------------------
Output potentiel                 | 5495.21 | 5627.86 | 5748.78 | 5857.95 | 5966.20 | 6103.63
Stock de capital                 | 8083.55 | 8359.89 | 8647.94 | 8910.34 | 9175.81 | 9468.89
Intensité de capital             |    0.50 |    0.49 |    0.48 |    0.46 |    0.45 |    0.43
Productivité totale des facteurs |    0.99 |    1.00 |    1.01 |    1.02 |    1.03 |    1.04

>>> df = computed_table.to_frame()
>>> df
period[file]                               00  ...           05
name                                           ...
Output potentiel                  5495.212782  ...  6103.631844
Stock de capital                  8083.551748  ...  9468.886506
Intensité de capital                 0.503166  ...     0.434914
Productivité totale des facteurs     0.993773  ...     1.044466

[4 rows x 6 columns]