{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# IODE and pandas\n", "\n", "IODE offers many ways to interact with pandas Series and DataFrame objects. \n", "\n", "Lets start with necessary imports and loading the sample data:" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "\n", "from iode import (SAMPLE_DATA_DIR, comments, equations, identities, lists, scalars, \n", " tables, variables, Sample, NA)" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Loading C:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data/fun.cmt\n", "317 objects loaded\n", "Loading C:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data/fun.eqs\n", "274 objects loaded\n", "Loading C:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data/fun.idt\n", "48 objects loaded\n", "Loading C:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data/fun.lst\n", "17 objects loaded\n", "Loading C:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data/fun.scl\n", "161 objects loaded\n", "Loading C:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data/fun.tbl\n", "46 objects loaded\n", "Loading C:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data/fun.var\n", "394 objects loaded\n" ] }, { "data": { "text/plain": [ "(317, 274, 48, 17, 161, 46, 394)" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# ---- load equations, identities, scalars and variables ----\n", "# Note: test binary and ASCII 'fun' files are located in the 'SAMPLE_DATA_DIR' \n", "# directory of the 'iode' package\n", "comments.load(f\"{SAMPLE_DATA_DIR}/fun.cmt\")\n", "equations.load(f\"{SAMPLE_DATA_DIR}/fun.eqs\")\n", "identities.load(f\"{SAMPLE_DATA_DIR}/fun.idt\")\n", "lists.load(f\"{SAMPLE_DATA_DIR}/fun.lst\")\n", "scalars.load(f\"{SAMPLE_DATA_DIR}/fun.scl\")\n", "tables.load(f\"{SAMPLE_DATA_DIR}/fun.tbl\")\n", "variables.load(f\"{SAMPLE_DATA_DIR}/fun.var\")\n", "\n", "# ---- print the number of objects present in the above workspaces ----\n", "len(comments), len(equations), len(identities), len(lists), len(scalars), len(tables), len(variables)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Update multiple IODE objects at once\n", "\n", "Using pandas Series and DataFrame objects, you can update multiple IODE objects at once. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Comments" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Workspace: Comments\n", "nb comments: 3\n", "filename: c:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data\\fun.cmt\n", "\n", "name\t comments \n", "ACAF\tUpdated ACAF from series\n", "ACAG\tUpdated ACAG from series\n", "AOUC\tUpdated AOUC from series" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# 2) using a pandas series\n", "data = [\"Updated AOUC from series\", \"Updated ACAF from series\", \"Updated ACAG from series\"]\n", "series = pd.Series(data, index=[\"AOUC\", \"ACAF\", \"ACAG\"])\n", "comments[\"ACAF, ACAG, AOUC\"] = series\n", "comments[\"ACAF, ACAG, AOUC\"]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Identities" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Workspace: Identities\n", "nb identities: 3\n", "filename: c:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data\\fun.idt\n", "\n", " name\t identities \n", "GAP2 \t0.8 * 100*(QAFF_/(Q_F+Q_I))\n", "GAP_ \t0.8 * 100*((QAF_/Q_F)-1) \n", "GOSFR\t0.8 * (GOSF/VAF_) " ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# using a pandas series\n", "data = [\"0.8 * 100*(QAFF_/(Q_F+Q_I))\", \"0.8 * 100*((QAF_/Q_F)-1)\", \"0.8 * (GOSF/VAF_)\"]\n", "series = pd.Series(data, index=[\"GAP2\", \"GAP_\", \"GOSFR\"])\n", "identities[\"GAP2, GAP_, GOSFR\"] = series\n", "identities[\"GAP2, GAP_, GOSFR\"]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Equations" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Workspace: Equations\n", "nb equations: 3\n", "filename: c:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data\\fun.eqs\n", "\n", "name\t lec \tmethod\t sample \tblock\tfstat \tr2adj \t dw \tloglik\tdate\n", "ACAF\t(ACAF/VAF[-1]) :=acaf1+acaf2*GOSF[-1]+ acaf4*(TIME=1995) \t GLS\t1980Y1:1996Y1\t \t0.0000\t0.0000\t0.0000\t0.0000\t \n", "ACAG\tACAG := ACAG[-1]+r VBBP[-1]+(0.006*VBBP[-1]*(TIME=2001)-0.008*(TIME=2008)) \t GLS\t1980Y1:1996Y1\t \t0.0000\t0.0000\t0.0000\t0.0000\t \n", "AOUC\tAOUC:=((WCRH/QL)/(WCRH/QL)[1990Y1])*(VAFF/(VM+VAFF))[-1]+PM*(VM/(VAFF+VM))[-1]\t GLS\t1980Y1:1996Y1\t \t0.0000\t0.0000\t0.0000\t0.0000\t " ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# using a pandas DataFrame\n", "data = []\n", "data.append([\"ACAF\", \"(ACAF/VAF[-1]) :=acaf1+acaf2*GOSF[-1]+ acaf4*(TIME=1995)\", \"GLS\", '1980Y1:1996Y1'])\n", "data.append([\"ACAG\", \"ACAG := ACAG[-1]+r VBBP[-1]+(0.006*VBBP[-1]*(TIME=2001)-0.008*(TIME=2008))\", \"GLS\", '1980Y1:1996Y1'])\n", "data.append([\"AOUC\", \"AOUC:=((WCRH/QL)/(WCRH/QL)[1990Y1])*(VAFF/(VM+VAFF))[-1]+PM*(VM/(VAFF+VM))[-1]\", \"GLS\", '1980Y1:1996Y1'])\n", "df = pd.DataFrame(data, index=[\"ACAF\", \"ACAG\", \"AOUC\"], columns=[\"endogenous\", \"lec\", \"method\", \"sample\"])\n", "equations[\"ACAF, ACAG, AOUC\"] = df\n", "equations[\"ACAF, ACAG, AOUC\"]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Lists" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Workspace: Lists\n", "nb lists: 3\n", "filename: c:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data\\fun.lst\n", "description: Modèle fun \n", "\n", " name \t lists \n", "ENVI \tPWMS; PWXAB; PWXS; QWXAB; QWXS; POIL \n", "IDT \tKL; PROD; QL; RDEBT; RENT; RLBER; SBGX; WCRH; IUGR; SBGXR; WBGR\n", "MAINEQ\tKNFF; PC; PXAB; PMAB; QXAB " ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# using a pandas series\n", "data = [\"PWMS; PWXAB; PWXS; QWXAB; QWXS; POIL\",\n", " \"KL; PROD; QL; RDEBT; RENT; RLBER; SBGX; WCRH; IUGR; SBGXR; WBGR\", \n", " \"KNFF; PC; PXAB; PMAB; QXAB\"]\n", "series = pd.Series(data, index=[\"ENVI\", \"IDT\", \"MAINEQ\"])\n", "lists[\"ENVI, IDT, MAINEQ\"] = series\n", "lists[\"ENVI, IDT, MAINEQ\"]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Scalars" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Workspace: Scalars\n", "nb scalars: 3\n", "filename: c:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data\\fun.scl\n", "\n", " name\t value \trelax \tstd\n", "acaf1\t 0.0150\t1.0000\t na\n", "acaf2\t-0.0009\t1.0000\t na\n", "acaf3\t 2.8000\t1.0000\t na" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# 1) using a pandas series (only scalar's values)\n", "data = [0.015, -9.e-04, 2.8]\n", "series = pd.Series(data, index=[\"acaf1\", \"acaf2\", \"acaf3\"])\n", "scalars[\"acaf1, acaf2, acaf3\"] = series\n", "scalars[\"acaf1, acaf2, acaf3\"]" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Workspace: Scalars\n", "nb scalars: 3\n", "filename: c:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data\\fun.scl\n", "\n", " name\t value \trelax \tstd\n", "acaf1\t 0.0140\t0.9800\t na\n", "acaf2\t-0.0007\t0.9500\t na\n", "acaf3\t 2.3000\t0.9200\t na" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# 2) using a pandas DataFrame (value + relax)\n", "data = [(0.014, 0.98), (-7.e-04, 0.95), (2.3, 0.92)]\n", "df = pd.DataFrame(data, index=[\"acaf1\", \"acaf2\", \"acaf3\"], columns=[\"value\", \"relax\"])\n", "scalars[\"acaf1, acaf2, acaf3\"] = df\n", "scalars[\"acaf1, acaf2, acaf3\"]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Variables" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
1991Y11992Y11993Y11994Y11995Y1
ACAF28.89031.9036.66042.139.920
ACAGNaN-39.96-42.880-16.33-41.160
AOUC1.023NaN1.046NaN1.064
\n", "
" ], "text/plain": [ " 1991Y1 1992Y1 1993Y1 1994Y1 1995Y1\n", "ACAF 28.890 31.90 36.660 42.13 9.920\n", "ACAG NaN -39.96 -42.880 -16.33 -41.160\n", "AOUC 1.023 NaN 1.046 NaN 1.064" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# using a pandas DataFrame\n", "data = [[28.89, 31.90, 36.66, 42.13, 9.92],\n", " [np.nan, -39.96, -42.88, -16.33, -41.16],\n", " [1.023, np.nan, 1.046, np.nan, 1.064]]\n", "periods = [\"1991Y1\", \"1992Y1\", \"1993Y1\", \"1994Y1\", \"1995Y1\"]\n", "df = pd.DataFrame(data, index=[\"ACAF\", \"ACAG\", \"AOUC\"], columns=periods)\n", "df" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Workspace: Variables\n", "nb variables: 3\n", "filename: c:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data\\fun.var\n", "description: Modèle fun - Simulation 1 \n", "sample: 1991Y1:1995Y1\n", "mode: LEVEL\n", "\n", "name\t1991Y1\t1992Y1\t1993Y1\t1994Y1\t1995Y1\n", "ACAF\t 28.89\t 31.90\t 36.66\t 42.13\t 9.92\n", "ACAG\t na\t-39.96\t-42.88\t-16.33\t-41.16\n", "AOUC\t 1.02\t na\t 1.05\t na\t 1.06" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "variables[\"ACAF, ACAG, AOUC\", \"1991Y1:1995Y1\"] = df\n", "variables[\"ACAF, ACAG, AOUC\", \"1991Y1:1995Y1\"]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## More On IODE Variables Database And pandas" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Add one variable:" ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Workspace: Variables\n", "nb variables: 1\n", "filename: c:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data\\fun.var\n", "description: Modèle fun - Simulation 1 \n", "sample: 1960Y1:2015Y1\n", "mode: LEVEL\n", "\n", "name\t1960Y1\t1961Y1\t1962Y1\t1963Y1\t1964Y1\t1965Y1\t...\t2009Y1\t2010Y1\t2011Y1\t2012Y1\t2013Y1\t2014Y1\t2015Y1\n", "A4 \t na\t 1.00\t 2.00\t 3.00\t 4.00\t 5.00\t...\t 49.00\t 50.00\t 51.00\t 52.00\t 53.00\t 54.00\t na" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# using a pandas Series\n", "data = list(range(variables.nb_periods))\n", "data[0] = NA\n", "data[-1] = np.nan\n", "values = pd.Series(data, index=variables.periods_as_str)\n", "variables[\"A4\"] = values\n", "variables[\"A4\"] " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Update a variable." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Update all values of a variable:" ] }, { "cell_type": "code", "execution_count": 41, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Workspace: Variables\n", "nb variables: 1\n", "filename: c:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data\\fun.var\n", "description: Modèle fun - Simulation 1 \n", "sample: 1960Y1:2015Y1\n", "mode: LEVEL\n", "\n", "name\t1960Y1\t1961Y1\t1962Y1\t1963Y1\t1964Y1\t1965Y1\t...\t2009Y1\t2010Y1\t2011Y1\t2012Y1\t2013Y1\t2014Y1\t2015Y1\n", "AOUC\t na\t 1.00\t 2.00\t 3.00\t 4.00\t 5.00\t...\t 49.00\t 50.00\t 51.00\t 52.00\t 53.00\t 54.00\t na" ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# using a pandas Series\n", "values = pd.Series(data, index=variables.periods_as_str)\n", "variables[\"AOUC\"] = values\n", "variables[\"AOUC\"]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Set the values for range of (contiguous) periods:" ] }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Workspace: Variables\n", "nb variables: 1\n", "filename: c:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data\\fun.var\n", "description: Modèle fun - Simulation 1 \n", "sample: 1991Y1:1995Y1\n", "mode: LEVEL\n", "\n", "name\t1991Y1\t1992Y1\t1993Y1\t1994Y1\t1995Y1\n", "AOUC\t 1.00\t na\t 3.00\t na\t 5.00" ] }, "execution_count": 42, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# variable[t:t+x] = pandas Series\n", "data = [1.0, NA, 3.0, np.nan, 5.0]\n", "periods = [\"1991Y1\", \"1992Y1\", \"1993Y1\", \"1994Y1\", \"1995Y1\"]\n", "variables[\"AOUC\", \"1991Y1:1995Y1\"] = pd.Series(data, index=periods)\n", "variables[\"AOUC\", \"1991Y1:1995Y1\"]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Arithmetic Operations On Variables With pandas Series And DataFrames \n", "\n", "IODE variables can be used in arithmetic operations with pandas Series and DataFrames.\n", "\n", "Let's first reload the variables database to start from a clean state. \n", "Then we will select a subset of variables for the examples below:" ] }, { "cell_type": "code", "execution_count": 43, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Loading C:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data/fun.var\n", "394 objects loaded\n" ] }, { "data": { "text/plain": [ "Workspace: Variables\n", "nb variables: 5\n", "filename: c:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data\\fun.var\n", "description: Modèle fun - Simulation 1 \n", "sample: 1991Y1:1995Y1\n", "mode: LEVEL\n", "\n", " name\t1991Y1\t1992Y1\t1993Y1\t1994Y1\t1995Y1\n", "ACAF \t 26.24\t 30.16\t 34.66\t 8.16\t-13.13\n", "ACAG \t-30.93\t-40.29\t-43.16\t-16.03\t-41.85\n", "AOUC \t 1.02\t 1.03\t 1.03\t 1.05\t 1.05\n", "AOUC_\t 0.96\t 0.97\t 0.98\t 0.99\t 1.00\n", "AQC \t 1.06\t 1.11\t 1.15\t 1.16\t 1.16" ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# reload variables to start from a clean state\n", "variables.load(f\"{SAMPLE_DATA_DIR}/fun.var\")\n", "\n", "# select a subset of variables for the examples below\n", "vars_subset = variables[\"A*\", \"1991Y1:1995Y1\"]\n", "vars_subset" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1991Y1 2.0\n", "1992Y1 3.0\n", "1993Y1 4.0\n", "1994Y1 5.0\n", "1995Y1 6.0\n", "dtype: float64" ] }, "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data = [2.0, 3.0, 4.0, 5.0, 6.0]\n", "series = pd.Series(data, index=vars_subset.periods_as_str)\n", "series" ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Workspace: Variables\n", "nb variables: 1\n", "filename: c:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data\\fun.var\n", "description: Modèle fun - Simulation 1 \n", "sample: 1991Y1:1995Y1\n", "mode: LEVEL\n", "\n", "name\t1991Y1\t1992Y1\t1993Y1\t1994Y1\t1995Y1\n", "ACAF\t 24.24\t 27.16\t 30.66\t 3.16\t-19.13" ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# subtract the values of a pandas Series \n", "# from the values of a single variable \n", "updated_ACAF = vars_subset[\"ACAF\"] - series\n", "updated_ACAF" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "ACAF 2.0\n", "ACAG 3.0\n", "AOUC 4.0\n", "AOUC_ 5.0\n", "AQC 6.0\n", "dtype: float64" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "series = pd.Series(data, index=vars_subset.names)\n", "series" ] }, { "cell_type": "code", "execution_count": 47, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Workspace: Variables\n", "nb variables: 5\n", "filename: c:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data\\fun.var\n", "description: Modèle fun - Simulation 1 \n", "sample: 1995Y1:1995Y1\n", "mode: LEVEL\n", "\n", " name\t1995Y1\n", "ACAF \t-15.13\n", "ACAG \t-44.85\n", "AOUC \t -2.95\n", "AOUC_\t -4.00\n", "AQC \t -4.84" ] }, "execution_count": 47, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# subtract the values of a pandas Series from the values \n", "# of a subset corresponding to a single period\n", "vars_subset_1995Y1 = vars_subset[:, \"1995Y1\"] - series\n", "vars_subset_1995Y1" ] }, { "cell_type": "code", "execution_count": 48, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
1991Y11992Y11993Y11994Y11995Y1
ACAF1.02.03.04.05.0
ACAG6.07.08.09.010.0
AOUC11.012.013.014.015.0
AOUC_16.017.018.019.020.0
AQC21.022.023.024.025.0
\n", "
" ], "text/plain": [ " 1991Y1 1992Y1 1993Y1 1994Y1 1995Y1\n", "ACAF 1.0 2.0 3.0 4.0 5.0\n", "ACAG 6.0 7.0 8.0 9.0 10.0\n", "AOUC 11.0 12.0 13.0 14.0 15.0\n", "AOUC_ 16.0 17.0 18.0 19.0 20.0\n", "AQC 21.0 22.0 23.0 24.0 25.0" ] }, "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\n", "# define the pandas DataFrame to be used in the example below\n", "data = np.array([[1.0, 2.0, 3.0, 4.0, 5.0],\n", " [6.0, 7.0, 8.0, 9.0, 10.0],\n", " [11.0, 12.0, 13.0, 14.0, 15.0],\n", " [16.0, 17.0, 18.0, 19.0, 20.0],\n", " [21.0, 22.0, 23.0, 24.0, 25.0]])\n", "df = pd.DataFrame(data, index=vars_subset.names, columns=vars_subset.periods_as_str)\n", "df" ] }, { "cell_type": "code", "execution_count": 49, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Workspace: Variables\n", "nb variables: 5\n", "filename: c:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data\\fun.var\n", "description: Modèle fun - Simulation 1 \n", "sample: 1991Y1:1995Y1\n", "mode: LEVEL\n", "\n", " name\t1991Y1\t1992Y1\t1993Y1\t1994Y1\t1995Y1\n", "ACAF \t 25.24\t 28.16\t 31.66\t 4.16\t-18.13\n", "ACAG \t-36.93\t-47.29\t-51.16\t-25.03\t-51.85\n", "AOUC \t -9.98\t-10.97\t-11.97\t-12.95\t-13.95\n", "AOUC_\t-15.04\t-16.03\t-17.02\t-18.01\t-19.00\n", "AQC \t-19.94\t-20.89\t-21.85\t-22.84\t-23.84" ] }, "execution_count": 49, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# subtract the values of a pandas DataFrame \n", "# from the values of a subset of variables \n", "new_vars_subset = vars_subset - df\n", "new_vars_subset" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Import/Export IODE workspaces from/to pandas Series and DataFrame\n", "\n", "To import / export the content of the `comments`, `identities` and `lists` workspaces from/to a pandas Series object, use the [from_series()](../_generated/iode.Comments.from_series.rst#iode.Comments.from_series) and [to_series()](../_generated/iode.Comments.to_series.rst#iode.Comments.to_series) methods. \n", "\n", "Alternatively, you can use the [series](../_generated/iode.Comments.series.rst#iode.Comments.series) property to export the content of the `comments`, `identities` and `lists` workspaces to a pandas Series object." ] }, { "cell_type": "code", "execution_count": 50, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Index: 317 entries, ACAF to ZZ_\n", "Series name: Comments\n", "Non-Null Count Dtype \n", "-------------- ----- \n", "317 non-null object\n", "dtypes: object(1)\n", "memory usage: 5.0+ KB\n", "Comments as pandas Series:\n", "None\n", "\n", "\n", "Index: 48 entries, AOUC to YSFICR\n", "Series name: Identities\n", "Non-Null Count Dtype \n", "-------------- ----- \n", "48 non-null object\n", "dtypes: object(1)\n", "memory usage: 768.0+ bytes\n", "Identities as pandas Series:\n", "None\n", "\n", "\n", "Index: 17 entries, COPY to _SEARCH\n", "Series name: Lists\n", "Non-Null Count Dtype \n", "-------------- ----- \n", "17 non-null object\n", "dtypes: object(1)\n", "memory usage: 272.0+ bytes\n", "Lists as pandas Series:\n", "None\n" ] } ], "source": [ "# ---- to pandas Series ----\n", "# See Comments/Identities/Lists.to_series and \n", "# Comments/Identities/Lists.series\n", "\n", "series_cmt = comments.to_series()\n", "print(f\"Comments as pandas Series:\\n{series_cmt.info()}\")\n", "print()\n", "\n", "series_idt = identities.to_series()\n", "print(f\"Identities as pandas Series:\\n{series_idt.info()}\")\n", "print()\n", "\n", "series_lst = lists.to_series()\n", "print(f\"Lists as pandas Series:\\n{series_lst.info()}\")\n", "\n", "# Alternatively\n", "\n", "series_cmt = comments.series\n", "series_idt = identities.series\n", "series_lst = lists.series\n", "\n", "# ---- from pandas Series ----\n", "# See Comments/Identities/Lists.from_series\n", "\n", "comments.from_series(series_cmt)\n", "identities.from_series(series_idt)\n", "lists.from_series(series_lst)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To import / export the content of the `equations`, `scalars` and `variables` workspaces from/to a pandas DataFrame object, use the [from_frame()](../_generated/iode.Variables.from_frame.rst#iode.Variables.from_frame) and [to_frame()](../_generated/iode.Variables.to_frame.rst#iode.Variables.to_frame) methods. \n", "\n", "Alternatively, you can use the [df](../_generated/iode.Variables.df.rst#iode.Variables.df) property to export the content of the `equations`, `scalars` and `variables` workspaces to a pandas DataFrame object." ] }, { "cell_type": "code", "execution_count": 51, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Loading C:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data/fun.cmt\n", "317 objects loaded\n", "Loading C:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data/fun.eqs\n", "274 objects loaded\n", "Loading C:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data/fun.idt\n", "48 objects loaded\n", "Loading C:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data/fun.lst\n", "17 objects loaded\n", "Loading C:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data/fun.scl\n", "161 objects loaded\n", "Loading C:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data/fun.tbl\n", "46 objects loaded\n", "Loading C:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data/fun.var\n", "394 objects loaded\n" ] } ], "source": [ "comments.load(f\"{SAMPLE_DATA_DIR}/fun.cmt\")\n", "equations.load(f\"{SAMPLE_DATA_DIR}/fun.eqs\")\n", "identities.load(f\"{SAMPLE_DATA_DIR}/fun.idt\")\n", "lists.load(f\"{SAMPLE_DATA_DIR}/fun.lst\")\n", "scalars.load(f\"{SAMPLE_DATA_DIR}/fun.scl\")\n", "tables.load(f\"{SAMPLE_DATA_DIR}/fun.tbl\")\n", "variables.load(f\"{SAMPLE_DATA_DIR}/fun.var\")" ] }, { "cell_type": "code", "execution_count": 52, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Index: 274 entries, ACAF to ZZF_\n", "Data columns (total 18 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 lec 274 non-null object \n", " 1 method 274 non-null object \n", " 2 sample 274 non-null object \n", " 3 comment 274 non-null object \n", " 4 instruments 274 non-null object \n", " 5 block 274 non-null object \n", " 6 corr 274 non-null float64\n", " 7 stdev 274 non-null float64\n", " 8 meany 274 non-null float64\n", " 9 ssres 274 non-null float64\n", " 10 stderr 274 non-null float64\n", " 11 stderrp 274 non-null float64\n", " 12 fstat 274 non-null float64\n", " 13 r2 274 non-null float64\n", " 14 r2adj 274 non-null float64\n", " 15 dw 274 non-null float64\n", " 16 loglik 274 non-null float64\n", " 17 date 274 non-null object \n", "dtypes: float64(11), object(7)\n", "memory usage: 40.7+ KB\n", "Equations as pandas DataFrame:\n", "None\n", "\n", "\n", "Index: 161 entries, acaf1 to zkf3\n", "Data columns (total 3 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 value 161 non-null float64\n", " 1 relax 161 non-null float64\n", " 2 std 142 non-null float64\n", "dtypes: float64(3)\n", "memory usage: 5.0+ KB\n", "Scalars as pandas DataFrame:\n", "None\n", "\n", "\n", "Index: 394 entries, ACAF to ZZF_\n", "Data columns (total 56 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 1960Y1 264 non-null float64\n", " 1 1961Y1 280 non-null float64\n", " 2 1962Y1 280 non-null float64\n", " 3 1963Y1 280 non-null float64\n", " 4 1964Y1 281 non-null float64\n", " 5 1965Y1 283 non-null float64\n", " 6 1966Y1 288 non-null float64\n", " 7 1967Y1 288 non-null float64\n", " 8 1968Y1 288 non-null float64\n", " 9 1969Y1 288 non-null float64\n", " 10 1970Y1 359 non-null float64\n", " 11 1971Y1 372 non-null float64\n", " 12 1972Y1 372 non-null float64\n", " 13 1973Y1 373 non-null float64\n", " 14 1974Y1 373 non-null float64\n", " 15 1975Y1 379 non-null float64\n", " 16 1976Y1 379 non-null float64\n", " 17 1977Y1 379 non-null float64\n", " 18 1978Y1 379 non-null float64\n", " 19 1979Y1 379 non-null float64\n", " 20 1980Y1 387 non-null float64\n", " 21 1981Y1 387 non-null float64\n", " 22 1982Y1 387 non-null float64\n", " 23 1983Y1 387 non-null float64\n", " 24 1984Y1 387 non-null float64\n", " 25 1985Y1 388 non-null float64\n", " 26 1986Y1 390 non-null float64\n", " 27 1987Y1 390 non-null float64\n", " 28 1988Y1 390 non-null float64\n", " 29 1989Y1 390 non-null float64\n", " 30 1990Y1 390 non-null float64\n", " 31 1991Y1 390 non-null float64\n", " 32 1992Y1 390 non-null float64\n", " 33 1993Y1 390 non-null float64\n", " 34 1994Y1 392 non-null float64\n", " 35 1995Y1 392 non-null float64\n", " 36 1996Y1 392 non-null float64\n", " 37 1997Y1 392 non-null float64\n", " 38 1998Y1 392 non-null float64\n", " 39 1999Y1 393 non-null float64\n", " 40 2000Y1 393 non-null float64\n", " 41 2001Y1 393 non-null float64\n", " 42 2002Y1 393 non-null float64\n", " 43 2003Y1 393 non-null float64\n", " 44 2004Y1 393 non-null float64\n", " 45 2005Y1 393 non-null float64\n", " 46 2006Y1 393 non-null float64\n", " 47 2007Y1 393 non-null float64\n", " 48 2008Y1 393 non-null float64\n", " 49 2009Y1 393 non-null float64\n", " 50 2010Y1 393 non-null float64\n", " 51 2011Y1 394 non-null float64\n", " 52 2012Y1 394 non-null float64\n", " 53 2013Y1 394 non-null float64\n", " 54 2014Y1 394 non-null float64\n", " 55 2015Y1 394 non-null float64\n", "dtypes: float64(56)\n", "memory usage: 175.5+ KB\n", "Variables as pandas DataFrame:\n", "None\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "c:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\time\\sample.py:240: UserWarning: 'sample' is not defined\n", " return self._cython_instance.__str__()\n", "c:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\time\\sample.py:240: UserWarning: 'sample' is not defined\n", " return self._cython_instance.__str__()\n" ] } ], "source": [ "# ---- to pandas DataFrame ----\n", "# See Equations/Scalars/Variables.to_frame and\n", "# Equations/Scalars/Variables.df\n", "\n", "df_eqs = equations.to_frame()\n", "print(f\"Equations as pandas DataFrame:\\n{df_eqs.info()}\")\n", "print()\n", "\n", "df_scl = scalars.to_frame()\n", "print(f\"Scalars as pandas DataFrame:\\n{df_scl.info()}\")\n", "print()\n", "\n", "df_vars = variables.to_frame()\n", "print(f\"Variables as pandas DataFrame:\\n{df_vars.info()}\")\n", "\n", "# Alternatively\n", "\n", "df_eqs = equations.df\n", "df_scl = scalars.df\n", "df_vars = variables.df\n", "\n", "# ---- from pandas DataFrame ----\n", "# See Equations/Scalars/Variables.from_frame\n", "\n", "equations.from_frame(df_eqs)\n", "scalars.from_frame(df_scl)\n", "variables.from_frame(df_vars)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It possible to export a subset of the IODE databases:" ] }, { "cell_type": "code", "execution_count": 53, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Workspace: Variables\n", "nb variables: 33\n", "filename: c:\\soft\\Miniconda3\\Lib\\site-packages\\iode\\tests\\data\\fun.var\n", "description: Modèle fun - Simulation 1 \n", "sample: 2000Y1:2010Y1\n", "mode: LEVEL\n", "\n", " name\t 2000Y1\t 2001Y1\t 2002Y1\t 2003Y1\t 2004Y1\t 2005Y1\t 2006Y1\t 2007Y1\t 2008Y1 \t 2009Y1 \t 2010Y1 \n", "ACAF \t 10.05\t 2.87\t -0.93\t -6.09\t -14.58\t -26.54\t -28.99\t -33.38\t -38.41\t -37.46\t -37.83\n", "ACAG \t -41.53\t 18.94\t 19.98\t 21.02\t 22.07\t 23.11\t 24.13\t 25.16\t 26.19\t 27.23\t 28.25\n", "AOUC \t 1.12\t 1.14\t 1.16\t 1.17\t 1.17\t 1.18\t 1.20\t 1.22\t 1.26\t 1.29\t 1.31\n", "AOUC_\t 1.10\t 1.14\t 1.15\t 1.16\t 1.15\t 1.16\t 1.19\t 1.20\t 1.21\t 1.23\t 1.25\n", "AQC \t 1.34\t 1.38\t 1.41\t 1.42\t 1.40\t 1.40\t 1.40\t 1.41\t 1.43\t 1.45\t 1.46\n", "... \t ...\t ...\t ...\t ...\t ...\t ...\t ...\t ...\t ...\t ...\t ...\n", "WCF_ \t3716.45\t3863.90\t3999.57\t4147.95\t4242.58\t4320.97\t4463.72\t4665.91\t 4916.65\t 5042.74\t 5170.60\n", "WIND_\t1000.14\t1035.22\t1070.93\t1102.91\t1115.33\t1124.07\t1144.27\t1178.12\t 1231.49\t 1268.86\t 1301.03\n", "WNF_ \t2334.76\t2427.49\t2512.87\t2606.28\t2665.82\t2715.11\t2804.93\t2932.23\t 3089.99\t 3169.32\t 3249.75\n", "YDH_ \t7276.61\t7635.91\t7958.39\t8331.07\t8653.40\t8950.54\t9299.54\t9685.61\t10228.84\t10630.74\t10995.83\n", "ZZF_ \t 0.69\t 0.69\t 0.69\t 0.69\t 0.69\t 0.69\t 0.69\t 0.69\t 0.69\t 0.69\t 0.69" ] }, "execution_count": 53, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# export a subset of the IODE Variables database as a pandas DataFrame\n", "vars_subset = variables[\"A*;*_\", \"2000Y1:2010Y1\"]\n", "vars_subset" ] }, { "cell_type": "code", "execution_count": 54, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(33, 11)" ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = vars_subset.to_frame()\n", "df.shape" ] }, { "cell_type": "code", "execution_count": 55, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
time2000Y12001Y12002Y12003Y12004Y12005Y12006Y12007Y12008Y12009Y12010Y1
names
ACAF10.0466112.867923-0.929213-6.091565-14.582094-26.538790-28.987288-33.378426-38.409518-37.463510-37.827429
ACAG-41.53478718.93980119.98081521.02050222.06647623.10796224.12963725.16090926.19211127.22995528.253929
AOUC1.1162381.1404761.1571691.1704901.1676751.1815211.1994621.2193331.2628061.2871321.307110
AOUC_1.1019571.1362441.1502151.1608291.1480211.1641231.1858971.1951661.2138341.2318541.250164
AQC1.3386031.3791881.4088161.4197051.4006521.3969731.3980641.4079131.4256451.4463321.462868
GAP_4.5100963.3214492.6475243.5303205.5695085.7169706.0226186.0178204.9443503.8230783.376524
GOSH_1957.0895202065.8334052150.5609582235.9109232338.7032262435.7281672488.5225292566.3433682666.9502772767.8773682834.234072
PAF_1.1974911.2296821.2599681.2861221.2959221.2862901.2833841.2884861.3050411.3267451.343502
PC_1.2347271.2689441.2936501.3124621.3265891.3490031.3713351.3952151.4438211.4714511.494820
PFI_1.0735161.1017701.1219741.1381751.1515831.1710211.1890401.2083631.2489721.2718131.292278
PROIHP_1.1054131.0888321.0724991.0564121.0405661.0249571.0095830.9944390.9795230.9648300.950357
QAFF_5748.5188805799.9490105873.7224796023.3358626233.0040516369.6690816562.2457496775.7031846888.4330296875.7778786973.598753
QAF_4785.2210494849.6092914924.7993855064.1423015261.2731135391.6021395564.8438355751.4203495847.7900325846.5232645936.558148
QAI_963.297144950.325805948.931158959.209351971.731901978.081737997.3773511024.2137631040.5529371029.1725591036.991863
QAT_7184.5697997271.2680167373.8611647552.9558087792.9224417960.1851328183.6012268428.9270498574.1021748594.6759018726.217012
QBBPPOT_7655.4818027846.6256518008.2572498161.0347358321.9486508515.4479008740.7015208988.5613949237.1963529445.5372869605.212226
QC_4855.4132784970.4069795028.9236925124.1983465256.4149285375.4876455457.6754865582.2807735730.7337015840.3095385889.766110
QQMAB_5180.2182155263.8842575380.6358655550.4826665814.0298396022.1712146314.2956556618.6877336799.9683526785.4008296936.181731
QS_-35.212024-35.212024-35.212024-35.212024-35.212024-35.212024-35.212024-35.212024-35.212024-35.212024-35.212024
TFPFHP_0.9937731.0037111.0137481.0238861.0341241.0444661.0549101.0654591.0761141.0868751.097744
VAFF_6883.8593917132.2157107400.6882317746.7541538076.9487698193.0692038421.9245978730.0842868989.5940869122.2832299369.040712
VAF_5730.3198825963.6144216205.0645406513.0977896817.7058376934.9823787141.9226437410.4299197631.6300207756.8333087975.839742
VAI_1153.5356951168.5852131195.6234011233.6548211259.2695481258.1023731279.9911451319.6676551357.9678001365.4350201393.190351
VAT_8880.7306649239.6719019617.67570010073.66629310492.97418210693.83102011025.80234111458.34986411871.10224812141.96062312525.581408
VC_5995.1083226307.1703466505.6710106725.3137216973.1047557251.5478417484.3030657788.4801738274.1545258593.7291108804.137738
VS_16.86042211.8642156.9464519.39529920.99308826.21013121.02544915.22363711.8794026.70254610.939950
WBF_2693.7277692800.5921862898.9356403006.4788193075.0418043131.8764473235.3338453381.8736673563.6225413655.0255183747.687849
WBU_5074.1906365296.6065445504.5052845725.4809505869.2886125991.0520466197.9622036485.7878026850.7362807067.1491167283.594651
WCF_3716.4475093863.8975503999.5733774147.9512364242.5777044320.9684444463.7231554665.9136114916.6509995042.7431185170.600010
WIND_1000.1445771035.2188001070.9328731102.9072841115.3343431124.0677201144.2654011178.1203521231.4878981268.8616471301.025126
WNF_2334.7636282427.4923342512.8675052606.2787862665.8160172715.1052562804.9348262932.2312543089.9936763169.3165443249.751702
YDH_7276.6077407635.9056677958.3944988331.0684878653.4027648950.5404469299.5365299685.61384510228.84090610630.73689610995.831393
ZZF_0.6884000.6884000.6884000.6884000.6884000.6884000.6884000.6884000.6884000.6884000.688400
\n", "
" ], "text/plain": [ "time 2000Y1 2001Y1 2002Y1 2003Y1 2004Y1 \\\n", "names \n", "ACAF 10.046611 2.867923 -0.929213 -6.091565 -14.582094 \n", "ACAG -41.534787 18.939801 19.980815 21.020502 22.066476 \n", "AOUC 1.116238 1.140476 1.157169 1.170490 1.167675 \n", "AOUC_ 1.101957 1.136244 1.150215 1.160829 1.148021 \n", "AQC 1.338603 1.379188 1.408816 1.419705 1.400652 \n", "GAP_ 4.510096 3.321449 2.647524 3.530320 5.569508 \n", "GOSH_ 1957.089520 2065.833405 2150.560958 2235.910923 2338.703226 \n", "PAF_ 1.197491 1.229682 1.259968 1.286122 1.295922 \n", "PC_ 1.234727 1.268944 1.293650 1.312462 1.326589 \n", "PFI_ 1.073516 1.101770 1.121974 1.138175 1.151583 \n", "PROIHP_ 1.105413 1.088832 1.072499 1.056412 1.040566 \n", "QAFF_ 5748.518880 5799.949010 5873.722479 6023.335862 6233.004051 \n", "QAF_ 4785.221049 4849.609291 4924.799385 5064.142301 5261.273113 \n", "QAI_ 963.297144 950.325805 948.931158 959.209351 971.731901 \n", "QAT_ 7184.569799 7271.268016 7373.861164 7552.955808 7792.922441 \n", "QBBPPOT_ 7655.481802 7846.625651 8008.257249 8161.034735 8321.948650 \n", "QC_ 4855.413278 4970.406979 5028.923692 5124.198346 5256.414928 \n", "QQMAB_ 5180.218215 5263.884257 5380.635865 5550.482666 5814.029839 \n", "QS_ -35.212024 -35.212024 -35.212024 -35.212024 -35.212024 \n", "TFPFHP_ 0.993773 1.003711 1.013748 1.023886 1.034124 \n", "VAFF_ 6883.859391 7132.215710 7400.688231 7746.754153 8076.948769 \n", "VAF_ 5730.319882 5963.614421 6205.064540 6513.097789 6817.705837 \n", "VAI_ 1153.535695 1168.585213 1195.623401 1233.654821 1259.269548 \n", "VAT_ 8880.730664 9239.671901 9617.675700 10073.666293 10492.974182 \n", "VC_ 5995.108322 6307.170346 6505.671010 6725.313721 6973.104755 \n", "VS_ 16.860422 11.864215 6.946451 9.395299 20.993088 \n", "WBF_ 2693.727769 2800.592186 2898.935640 3006.478819 3075.041804 \n", "WBU_ 5074.190636 5296.606544 5504.505284 5725.480950 5869.288612 \n", "WCF_ 3716.447509 3863.897550 3999.573377 4147.951236 4242.577704 \n", "WIND_ 1000.144577 1035.218800 1070.932873 1102.907284 1115.334343 \n", "WNF_ 2334.763628 2427.492334 2512.867505 2606.278786 2665.816017 \n", "YDH_ 7276.607740 7635.905667 7958.394498 8331.068487 8653.402764 \n", "ZZF_ 0.688400 0.688400 0.688400 0.688400 0.688400 \n", "\n", "time 2005Y1 2006Y1 2007Y1 2008Y1 \\\n", "names \n", "ACAF -26.538790 -28.987288 -33.378426 -38.409518 \n", "ACAG 23.107962 24.129637 25.160909 26.192111 \n", "AOUC 1.181521 1.199462 1.219333 1.262806 \n", "AOUC_ 1.164123 1.185897 1.195166 1.213834 \n", "AQC 1.396973 1.398064 1.407913 1.425645 \n", "GAP_ 5.716970 6.022618 6.017820 4.944350 \n", "GOSH_ 2435.728167 2488.522529 2566.343368 2666.950277 \n", "PAF_ 1.286290 1.283384 1.288486 1.305041 \n", "PC_ 1.349003 1.371335 1.395215 1.443821 \n", "PFI_ 1.171021 1.189040 1.208363 1.248972 \n", "PROIHP_ 1.024957 1.009583 0.994439 0.979523 \n", "QAFF_ 6369.669081 6562.245749 6775.703184 6888.433029 \n", "QAF_ 5391.602139 5564.843835 5751.420349 5847.790032 \n", "QAI_ 978.081737 997.377351 1024.213763 1040.552937 \n", "QAT_ 7960.185132 8183.601226 8428.927049 8574.102174 \n", "QBBPPOT_ 8515.447900 8740.701520 8988.561394 9237.196352 \n", "QC_ 5375.487645 5457.675486 5582.280773 5730.733701 \n", "QQMAB_ 6022.171214 6314.295655 6618.687733 6799.968352 \n", "QS_ -35.212024 -35.212024 -35.212024 -35.212024 \n", "TFPFHP_ 1.044466 1.054910 1.065459 1.076114 \n", "VAFF_ 8193.069203 8421.924597 8730.084286 8989.594086 \n", "VAF_ 6934.982378 7141.922643 7410.429919 7631.630020 \n", "VAI_ 1258.102373 1279.991145 1319.667655 1357.967800 \n", "VAT_ 10693.831020 11025.802341 11458.349864 11871.102248 \n", "VC_ 7251.547841 7484.303065 7788.480173 8274.154525 \n", "VS_ 26.210131 21.025449 15.223637 11.879402 \n", "WBF_ 3131.876447 3235.333845 3381.873667 3563.622541 \n", "WBU_ 5991.052046 6197.962203 6485.787802 6850.736280 \n", "WCF_ 4320.968444 4463.723155 4665.913611 4916.650999 \n", "WIND_ 1124.067720 1144.265401 1178.120352 1231.487898 \n", "WNF_ 2715.105256 2804.934826 2932.231254 3089.993676 \n", "YDH_ 8950.540446 9299.536529 9685.613845 10228.840906 \n", "ZZF_ 0.688400 0.688400 0.688400 0.688400 \n", "\n", "time 2009Y1 2010Y1 \n", "names \n", "ACAF -37.463510 -37.827429 \n", "ACAG 27.229955 28.253929 \n", "AOUC 1.287132 1.307110 \n", "AOUC_ 1.231854 1.250164 \n", "AQC 1.446332 1.462868 \n", "GAP_ 3.823078 3.376524 \n", "GOSH_ 2767.877368 2834.234072 \n", "PAF_ 1.326745 1.343502 \n", "PC_ 1.471451 1.494820 \n", "PFI_ 1.271813 1.292278 \n", "PROIHP_ 0.964830 0.950357 \n", "QAFF_ 6875.777878 6973.598753 \n", "QAF_ 5846.523264 5936.558148 \n", "QAI_ 1029.172559 1036.991863 \n", "QAT_ 8594.675901 8726.217012 \n", "QBBPPOT_ 9445.537286 9605.212226 \n", "QC_ 5840.309538 5889.766110 \n", "QQMAB_ 6785.400829 6936.181731 \n", "QS_ -35.212024 -35.212024 \n", "TFPFHP_ 1.086875 1.097744 \n", "VAFF_ 9122.283229 9369.040712 \n", "VAF_ 7756.833308 7975.839742 \n", "VAI_ 1365.435020 1393.190351 \n", "VAT_ 12141.960623 12525.581408 \n", "VC_ 8593.729110 8804.137738 \n", "VS_ 6.702546 10.939950 \n", "WBF_ 3655.025518 3747.687849 \n", "WBU_ 7067.149116 7283.594651 \n", "WCF_ 5042.743118 5170.600010 \n", "WIND_ 1268.861647 1301.025126 \n", "WNF_ 3169.316544 3249.751702 \n", "YDH_ 10630.736896 10995.831393 \n", "ZZF_ 0.688400 0.688400 " ] }, "execution_count": 55, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For the `variables` workspace, the [to_frame()](../_generated/iode.Variables.to_frame.rst#iode.Variables.to_frame) method have additional arguments. For instance, the `periods_as_type` argument allows to export the periods as a specific type. The `periods_as_type` argument can be one of the following: `str`, `int` or `float`. The default value is `str`:" ] }, { "cell_type": "code", "execution_count": 56, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
years20002001200220032004200520062007200820092010
names
ACAF10.0466112.867923-0.929213-6.091565-14.582094-26.538790-28.987288-33.378426-38.409518-37.463510-37.827429
ACAG-41.53478718.93980119.98081521.02050222.06647623.10796224.12963725.16090926.19211127.22995528.253929
AOUC1.1162381.1404761.1571691.1704901.1676751.1815211.1994621.2193331.2628061.2871321.307110
AOUC_1.1019571.1362441.1502151.1608291.1480211.1641231.1858971.1951661.2138341.2318541.250164
AQC1.3386031.3791881.4088161.4197051.4006521.3969731.3980641.4079131.4256451.4463321.462868
GAP_4.5100963.3214492.6475243.5303205.5695085.7169706.0226186.0178204.9443503.8230783.376524
GOSH_1957.0895202065.8334052150.5609582235.9109232338.7032262435.7281672488.5225292566.3433682666.9502772767.8773682834.234072
PAF_1.1974911.2296821.2599681.2861221.2959221.2862901.2833841.2884861.3050411.3267451.343502
PC_1.2347271.2689441.2936501.3124621.3265891.3490031.3713351.3952151.4438211.4714511.494820
PFI_1.0735161.1017701.1219741.1381751.1515831.1710211.1890401.2083631.2489721.2718131.292278
PROIHP_1.1054131.0888321.0724991.0564121.0405661.0249571.0095830.9944390.9795230.9648300.950357
QAFF_5748.5188805799.9490105873.7224796023.3358626233.0040516369.6690816562.2457496775.7031846888.4330296875.7778786973.598753
QAF_4785.2210494849.6092914924.7993855064.1423015261.2731135391.6021395564.8438355751.4203495847.7900325846.5232645936.558148
QAI_963.297144950.325805948.931158959.209351971.731901978.081737997.3773511024.2137631040.5529371029.1725591036.991863
QAT_7184.5697997271.2680167373.8611647552.9558087792.9224417960.1851328183.6012268428.9270498574.1021748594.6759018726.217012
QBBPPOT_7655.4818027846.6256518008.2572498161.0347358321.9486508515.4479008740.7015208988.5613949237.1963529445.5372869605.212226
QC_4855.4132784970.4069795028.9236925124.1983465256.4149285375.4876455457.6754865582.2807735730.7337015840.3095385889.766110
QQMAB_5180.2182155263.8842575380.6358655550.4826665814.0298396022.1712146314.2956556618.6877336799.9683526785.4008296936.181731
QS_-35.212024-35.212024-35.212024-35.212024-35.212024-35.212024-35.212024-35.212024-35.212024-35.212024-35.212024
TFPFHP_0.9937731.0037111.0137481.0238861.0341241.0444661.0549101.0654591.0761141.0868751.097744
VAFF_6883.8593917132.2157107400.6882317746.7541538076.9487698193.0692038421.9245978730.0842868989.5940869122.2832299369.040712
VAF_5730.3198825963.6144216205.0645406513.0977896817.7058376934.9823787141.9226437410.4299197631.6300207756.8333087975.839742
VAI_1153.5356951168.5852131195.6234011233.6548211259.2695481258.1023731279.9911451319.6676551357.9678001365.4350201393.190351
VAT_8880.7306649239.6719019617.67570010073.66629310492.97418210693.83102011025.80234111458.34986411871.10224812141.96062312525.581408
VC_5995.1083226307.1703466505.6710106725.3137216973.1047557251.5478417484.3030657788.4801738274.1545258593.7291108804.137738
VS_16.86042211.8642156.9464519.39529920.99308826.21013121.02544915.22363711.8794026.70254610.939950
WBF_2693.7277692800.5921862898.9356403006.4788193075.0418043131.8764473235.3338453381.8736673563.6225413655.0255183747.687849
WBU_5074.1906365296.6065445504.5052845725.4809505869.2886125991.0520466197.9622036485.7878026850.7362807067.1491167283.594651
WCF_3716.4475093863.8975503999.5733774147.9512364242.5777044320.9684444463.7231554665.9136114916.6509995042.7431185170.600010
WIND_1000.1445771035.2188001070.9328731102.9072841115.3343431124.0677201144.2654011178.1203521231.4878981268.8616471301.025126
WNF_2334.7636282427.4923342512.8675052606.2787862665.8160172715.1052562804.9348262932.2312543089.9936763169.3165443249.751702
YDH_7276.6077407635.9056677958.3944988331.0684878653.4027648950.5404469299.5365299685.61384510228.84090610630.73689610995.831393
ZZF_0.6884000.6884000.6884000.6884000.6884000.6884000.6884000.6884000.6884000.6884000.688400
\n", "
" ], "text/plain": [ "years 2000 2001 2002 2003 2004 \\\n", "names \n", "ACAF 10.046611 2.867923 -0.929213 -6.091565 -14.582094 \n", "ACAG -41.534787 18.939801 19.980815 21.020502 22.066476 \n", "AOUC 1.116238 1.140476 1.157169 1.170490 1.167675 \n", "AOUC_ 1.101957 1.136244 1.150215 1.160829 1.148021 \n", "AQC 1.338603 1.379188 1.408816 1.419705 1.400652 \n", "GAP_ 4.510096 3.321449 2.647524 3.530320 5.569508 \n", "GOSH_ 1957.089520 2065.833405 2150.560958 2235.910923 2338.703226 \n", "PAF_ 1.197491 1.229682 1.259968 1.286122 1.295922 \n", "PC_ 1.234727 1.268944 1.293650 1.312462 1.326589 \n", "PFI_ 1.073516 1.101770 1.121974 1.138175 1.151583 \n", "PROIHP_ 1.105413 1.088832 1.072499 1.056412 1.040566 \n", "QAFF_ 5748.518880 5799.949010 5873.722479 6023.335862 6233.004051 \n", "QAF_ 4785.221049 4849.609291 4924.799385 5064.142301 5261.273113 \n", "QAI_ 963.297144 950.325805 948.931158 959.209351 971.731901 \n", "QAT_ 7184.569799 7271.268016 7373.861164 7552.955808 7792.922441 \n", "QBBPPOT_ 7655.481802 7846.625651 8008.257249 8161.034735 8321.948650 \n", "QC_ 4855.413278 4970.406979 5028.923692 5124.198346 5256.414928 \n", "QQMAB_ 5180.218215 5263.884257 5380.635865 5550.482666 5814.029839 \n", "QS_ -35.212024 -35.212024 -35.212024 -35.212024 -35.212024 \n", "TFPFHP_ 0.993773 1.003711 1.013748 1.023886 1.034124 \n", "VAFF_ 6883.859391 7132.215710 7400.688231 7746.754153 8076.948769 \n", "VAF_ 5730.319882 5963.614421 6205.064540 6513.097789 6817.705837 \n", "VAI_ 1153.535695 1168.585213 1195.623401 1233.654821 1259.269548 \n", "VAT_ 8880.730664 9239.671901 9617.675700 10073.666293 10492.974182 \n", "VC_ 5995.108322 6307.170346 6505.671010 6725.313721 6973.104755 \n", "VS_ 16.860422 11.864215 6.946451 9.395299 20.993088 \n", "WBF_ 2693.727769 2800.592186 2898.935640 3006.478819 3075.041804 \n", "WBU_ 5074.190636 5296.606544 5504.505284 5725.480950 5869.288612 \n", "WCF_ 3716.447509 3863.897550 3999.573377 4147.951236 4242.577704 \n", "WIND_ 1000.144577 1035.218800 1070.932873 1102.907284 1115.334343 \n", "WNF_ 2334.763628 2427.492334 2512.867505 2606.278786 2665.816017 \n", "YDH_ 7276.607740 7635.905667 7958.394498 8331.068487 8653.402764 \n", "ZZF_ 0.688400 0.688400 0.688400 0.688400 0.688400 \n", "\n", "years 2005 2006 2007 2008 \\\n", "names \n", "ACAF -26.538790 -28.987288 -33.378426 -38.409518 \n", "ACAG 23.107962 24.129637 25.160909 26.192111 \n", "AOUC 1.181521 1.199462 1.219333 1.262806 \n", "AOUC_ 1.164123 1.185897 1.195166 1.213834 \n", "AQC 1.396973 1.398064 1.407913 1.425645 \n", "GAP_ 5.716970 6.022618 6.017820 4.944350 \n", "GOSH_ 2435.728167 2488.522529 2566.343368 2666.950277 \n", "PAF_ 1.286290 1.283384 1.288486 1.305041 \n", "PC_ 1.349003 1.371335 1.395215 1.443821 \n", "PFI_ 1.171021 1.189040 1.208363 1.248972 \n", "PROIHP_ 1.024957 1.009583 0.994439 0.979523 \n", "QAFF_ 6369.669081 6562.245749 6775.703184 6888.433029 \n", "QAF_ 5391.602139 5564.843835 5751.420349 5847.790032 \n", "QAI_ 978.081737 997.377351 1024.213763 1040.552937 \n", "QAT_ 7960.185132 8183.601226 8428.927049 8574.102174 \n", "QBBPPOT_ 8515.447900 8740.701520 8988.561394 9237.196352 \n", "QC_ 5375.487645 5457.675486 5582.280773 5730.733701 \n", "QQMAB_ 6022.171214 6314.295655 6618.687733 6799.968352 \n", "QS_ -35.212024 -35.212024 -35.212024 -35.212024 \n", "TFPFHP_ 1.044466 1.054910 1.065459 1.076114 \n", "VAFF_ 8193.069203 8421.924597 8730.084286 8989.594086 \n", "VAF_ 6934.982378 7141.922643 7410.429919 7631.630020 \n", "VAI_ 1258.102373 1279.991145 1319.667655 1357.967800 \n", "VAT_ 10693.831020 11025.802341 11458.349864 11871.102248 \n", "VC_ 7251.547841 7484.303065 7788.480173 8274.154525 \n", "VS_ 26.210131 21.025449 15.223637 11.879402 \n", "WBF_ 3131.876447 3235.333845 3381.873667 3563.622541 \n", "WBU_ 5991.052046 6197.962203 6485.787802 6850.736280 \n", "WCF_ 4320.968444 4463.723155 4665.913611 4916.650999 \n", "WIND_ 1124.067720 1144.265401 1178.120352 1231.487898 \n", "WNF_ 2715.105256 2804.934826 2932.231254 3089.993676 \n", "YDH_ 8950.540446 9299.536529 9685.613845 10228.840906 \n", "ZZF_ 0.688400 0.688400 0.688400 0.688400 \n", "\n", "years 2009 2010 \n", "names \n", "ACAF -37.463510 -37.827429 \n", "ACAG 27.229955 28.253929 \n", "AOUC 1.287132 1.307110 \n", "AOUC_ 1.231854 1.250164 \n", "AQC 1.446332 1.462868 \n", "GAP_ 3.823078 3.376524 \n", "GOSH_ 2767.877368 2834.234072 \n", "PAF_ 1.326745 1.343502 \n", "PC_ 1.471451 1.494820 \n", "PFI_ 1.271813 1.292278 \n", "PROIHP_ 0.964830 0.950357 \n", "QAFF_ 6875.777878 6973.598753 \n", "QAF_ 5846.523264 5936.558148 \n", "QAI_ 1029.172559 1036.991863 \n", "QAT_ 8594.675901 8726.217012 \n", "QBBPPOT_ 9445.537286 9605.212226 \n", "QC_ 5840.309538 5889.766110 \n", "QQMAB_ 6785.400829 6936.181731 \n", "QS_ -35.212024 -35.212024 \n", "TFPFHP_ 1.086875 1.097744 \n", "VAFF_ 9122.283229 9369.040712 \n", "VAF_ 7756.833308 7975.839742 \n", "VAI_ 1365.435020 1393.190351 \n", "VAT_ 12141.960623 12525.581408 \n", "VC_ 8593.729110 8804.137738 \n", "VS_ 6.702546 10.939950 \n", "WBF_ 3655.025518 3747.687849 \n", "WBU_ 7067.149116 7283.594651 \n", "WCF_ 5042.743118 5170.600010 \n", "WIND_ 1268.861647 1301.025126 \n", "WNF_ 3169.316544 3249.751702 \n", "YDH_ 10630.736896 10995.831393 \n", "ZZF_ 0.688400 0.688400 " ] }, "execution_count": 56, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = vars_subset.to_frame(time_axis_name=\"years\", periods_as_type=int)\n", "df" ] } ], "metadata": { "kernelspec": { "display_name": "base", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.9" } }, "nbformat": 4, "nbformat_minor": 2 }