{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Importing various data table formats\n", "\n", "The default input/output (io) format of the **pyam** package is the *tabular, wide data format*,\n", "where the columns represent the time domain.\n", "This follows the standard established by the *Integrated Assessment Modeling Consortium*\n", "([IAMC](https://www.iamconsortium.org/));\n", "[read the docs](https://pyam-iamc.readthedocs.io/en/stable/data.html) for more information.\n", "\n", "Alas, to make using the package as easy as possible, iniatilizing an **IamDataFrame** will accept a variety of different table formats\n", "and allows specifying missing columns via keyword arguments.\n", "This way, a user can import their data into **pyam** as easily as possible without needing to worry (more than necessary) about manipulating the original, raw timeseries data.\n", "\n", "This tutorial illustrates the broad range of possible formats\n", "to facilitate choosing the one that works for *your data*!\n", "\n", "## Overview\n", "\n", "The first section shows the standard [pandas.DataFrame](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html) (a.k.a. table) used in the **pyam** test suite.\n", "The following sections shows modifications of this dataframe\n", "and the necessary (if any) additional specifications to initialize an **IamDataFrame**.\n", "The last cell of each section uses the [equals()](https://pyam-iamc.readthedocs.io/en/stable/api/iamdataframe.html#pyam.IamDataFrame.equals) function\n", "to assert that the **IamDataFrame** in that section is identical to the object in the first section.\n", "\n", "It does not matter whether an **IamDataFrame** is initialized from a [pandas.DataFrame](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html)\n", "or a path to a `xslsx`/`csv` file with the data in the given format.\n", "For simplicity, this tutorial only uses dataframes.\n", "\n", "