iode.ComputedTable.plot_data
- property ComputedTable.plot_data: Dict[str, Tuple[ndarray, ndarray]]
Returns a dictionary containing the data to be plotted. The keys are the series names, and the values are tuples containing the x and y data as numpy arrays. The x data corresponds to the periods, and the y data corresponds to the values for each series.
- Returns:
- Dict[str, Tuple[np.ndarray, np.ndarray]]
A dictionary where keys are series names and values are tuples of (x_data, y_data).
Examples
>>> import numpy as np >>> 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") >>> series = computed_table.plot_data >>> x_data = series['Output potentiel'][0] >>> f"x_data={x_data.tolist()}" 'x_data=[2000.0, 2001.0, 2002.0, 2003.0, 2004.0, 2005.0]' >>> for series_name, (x_data, y_data) in series.items(): ... print(f"{series_name}: y_data={np.round(y_data, 6).tolist()}") Output potentiel: y_data=[5495.212782, 5627.858893, ..., 5966.199911, 6103.631844] Stock de capital: y_data=[8083.551748, 8359.890816, ..., 9175.810569, 9468.886506] Intensité de capital: y_data=[0.503166, 0.489608, ..., 0.448077, 0.434914] Productivité totale des facteurs: y_data=[0.993773, 1.003711, ..., 1.034124, 1.044466]