From 79a00bf4faa8c3cf9260e36891082a4b5e9d6d42 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 6 Apr 2021 19:56:21 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Try=20ISTAT=20source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.ipynb | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/README.ipynb b/README.ipynb index a3e5ba6..078ec85 100644 --- a/README.ipynb +++ b/README.ipynb @@ -49,8 +49,17 @@ }, { "cell_type": "code", - "execution_count": null, - "outputs": [], + "execution_count": 2, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/mnt/tera/ext4/code/sdmx-sandbox/venv/lib/python3.9/site-packages/pandasdmx/remote.py:11: RuntimeWarning: optional dependency requests_cache is not installed; cache options to Session() have no effect\n", + " warn(\n" + ] + } + ], "source": [ "import pandas\n", "import pandasdmx\n", @@ -593,11 +602,39 @@ } } }, + { + "cell_type": "markdown", + "source": [ + "## Proviamo con l'`ISTAT`" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%% md\n" + } + } + }, { "cell_type": "code", - "execution_count": null, - "outputs": [], - "source": [], + "execution_count": 5, + "outputs": [ + { + "data": { + "text/plain": "(101_1015 Crops\n 101_1030 PDO, PGI and TSG quality products\n 101_1033 slaughtering\n 101_1039 Agritourism - municipalities\n 101_1077 PDO, PGI and TSG products: operators - munici...\n ... \n 97_953 Environmental protection expenditure\n 98_1066 Productivity measures - Accounts in the 2014 v...\n 98_1067 Productivity measures - Accounts in the 2011 v...\n 98_197 Productivity measures\n 9_951 Mining and quarrying\n Length: 458, dtype: object,\n DCSP_COLTIVAZIONI \n DCSP_DOPIGP \n DCSP_MACELLAZIONI \n DCSP_AGRITURISMO_COM \n DCSP_DOPIGP_COM \n ..\n DCCN_SPESAPROTAMB \n DCCN_PRODUTTIVITA_B14 \n DCCN_PRODUTTIVITA_B11 \n DCCN_PRODUTTIVITA \n DCCV_CAVE_MIN \n Length: 447, dtype: object)" + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "istat: pandasdmx.Request = pandasdmx.Request(\"ISTAT\")\n", + "istat_flows_msg: pandasdmx.message.Message = istat.dataflow()\n", + "_dict: dict[str, pandas.Series] = istat_flows_msg.to_pandas()\n", + "istat_flows: pandas.Series = _dict[\"dataflow\"]\n", + "istat_structs: pandas.Series = _dict[\"structure\"]\n", + "istat_flows, istat_structs" + ], "metadata": { "collapsed": false, "pycharm": {