{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "9de5907f-18f5-4cb1-903e-26028ff1fa03", "metadata": { "execution": { "iopub.execute_input": "2023-01-17T17:37:37.394604Z", "iopub.status.busy": "2023-01-17T17:37:37.394125Z", "iopub.status.idle": "2023-01-17T17:37:37.401648Z", "shell.execute_reply": "2023-01-17T17:37:37.401042Z" } }, "outputs": [], "source": [ "import os\n", "import sys\n", "\n", "module_path = os.path.abspath(os.path.join('..'))\n", "if module_path not in sys.path:\n", " sys.path.append(module_path)\n" ] }, { "cell_type": "code", "execution_count": 2, "id": "640be762", "metadata": { "execution": { "iopub.execute_input": "2023-01-17T17:37:37.404116Z", "iopub.status.busy": "2023-01-17T17:37:37.403927Z", "iopub.status.idle": "2023-01-17T17:37:37.904770Z", "shell.execute_reply": "2023-01-17T17:37:37.904183Z" } }, "outputs": [], "source": [ "import pandas as pd\n", "from DateProvider import DateProvider\n", "from datetime import datetime\n", "from ColumnsAdder import ColumnsAdder\n", "from MedianOfFreeBedsByKreisTableFactory import MedianOfFreeBedsByKreisTableFactory\n", "from TimeseriesReader import readTimeseries\n", "from IntensivstationenHtmlFileUpdater import saveLastUpdatedIntensivstationen, saveKreisOptions\n", "from KreiseReader import readKreise\n", "from KreisOptionsProvider import getKreisOptionsAndAlleLandkreise\n", "from IntensiveCareBedsPersister import getAndPersistIntensiveCareBeds4AlleKreise\n", "from Chart import createMedianOfFreeBedsByKreisChart\n", "\n", "\n", "pd.set_option('display.max_rows', 100)\n", "pd.set_option('display.max_columns', None)\n", "pd.set_option('mode.chained_assignment', 'raise')\n" ] }, { "cell_type": "code", "execution_count": 3, "id": "e40d4c8d", "metadata": { "execution": { "iopub.execute_input": "2023-01-17T17:37:37.908094Z", "iopub.status.busy": "2023-01-17T17:37:37.907544Z", "iopub.status.idle": "2023-01-17T17:37:37.912078Z", "shell.execute_reply": "2023-01-17T17:37:37.910743Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "17.01.2023, 17:37:37 Uhr\n" ] } ], "source": [ "print(datetime.now().strftime(\"%d.%m.%Y, %H:%M:%S Uhr\"))" ] }, { "cell_type": "code", "execution_count": 4, "id": "336f56e6", "metadata": { "execution": { "iopub.execute_input": "2023-01-17T17:37:37.914630Z", "iopub.status.busy": "2023-01-17T17:37:37.914193Z", "iopub.status.idle": "2023-01-17T17:37:49.924558Z", "shell.execute_reply": "2023-01-17T17:37:49.923999Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " lastUpdated: 2023-01-17 11:49:00\n", "lastUpdatedDataSource: 2023-01-17 11:49:00\n", "needsUpdate: True\n" ] } ], "source": [ "dateProvider = DateProvider()\n", "print(' lastUpdated:', dateProvider.getLastUpdated())\n", "print('lastUpdatedDataSource:', dateProvider.getLastUpdatedDataSource()) \n", "needsUpdate = True # dateProvider.needsUpdate()\n", "print('needsUpdate:', needsUpdate)" ] }, { "cell_type": "code", "execution_count": 5, "id": "63be303c", "metadata": { "execution": { "iopub.execute_input": "2023-01-17T17:37:49.928436Z", "iopub.status.busy": "2023-01-17T17:37:49.927933Z", "iopub.status.idle": "2023-01-17T17:37:49.948613Z", "shell.execute_reply": "2023-01-17T17:37:49.948082Z" } }, "outputs": [], "source": [ "saveLastUpdatedIntensivstationen(\n", " dateProvider.getLastUpdatedDataSource(),\n", " toHtmlFile = \"../../docs/intensivstationen.html\")" ] }, { "cell_type": "code", "execution_count": 6, "id": "3f992231", "metadata": { "execution": { "iopub.execute_input": "2023-01-17T17:37:49.951179Z", "iopub.status.busy": "2023-01-17T17:37:49.950887Z", "iopub.status.idle": "2023-01-17T17:37:53.914217Z", "shell.execute_reply": "2023-01-17T17:37:53.913478Z" } }, "outputs": [ { "data": { "text/html": [ "
| \n", " | date | \n", "bundesland | \n", "gemeindeschluessel | \n", "betten_frei | \n", "betten_belegt | \n", "Kreis | \n", "Einwohnerzahl | \n", "Bundesland | \n", "
|---|---|---|---|---|---|---|---|---|
| 0 | \n", "2020-04-24 | \n", "01 | \n", "01001 | \n", "40 | \n", "38 | \n", "Flensburg, Stadt | \n", "89934.0 | \n", "Schleswig-Holstein | \n", "
| 267 | \n", "2020-04-24 | \n", "09 | \n", "09471 | \n", "9 | \n", "9 | \n", "Bamberg | \n", "147497.0 | \n", "Bayern | \n", "
| 266 | \n", "2020-04-24 | \n", "09 | \n", "09464 | \n", "17 | \n", "23 | \n", "Hof | \n", "45173.0 | \n", "Bayern | \n", "
| 265 | \n", "2020-04-24 | \n", "09 | \n", "09463 | \n", "9 | \n", "25 | \n", "Coburg | \n", "40842.0 | \n", "Bayern | \n", "
| 264 | \n", "2020-04-24 | \n", "09 | \n", "09462 | \n", "12 | \n", "51 | \n", "Bayreuth | \n", "74048.0 | \n", "Bayern | \n", "
| ... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
| 395141 | \n", "2023-01-17 | \n", "06 | \n", "06437 | \n", "3 | \n", "141 | \n", "Odenwaldkreis | \n", "96754.0 | \n", "Hessen | \n", "
| 395140 | \n", "2023-01-17 | \n", "06 | \n", "06436 | \n", "3 | \n", "17 | \n", "Main-Taunus-Kreis | \n", "239264.0 | \n", "Hessen | \n", "
| 395139 | \n", "2023-01-17 | \n", "06 | \n", "06435 | \n", "8 | \n", "64 | \n", "Main-Kinzig-Kreis | \n", "421689.0 | \n", "Hessen | \n", "
| 395137 | \n", "2023-01-17 | \n", "06 | \n", "06433 | \n", "1 | \n", "22 | \n", "Groß-Gerau | \n", "275807.0 | \n", "Hessen | \n", "
| 395410 | \n", "2023-01-17 | \n", "16 | \n", "16077 | \n", "8 | \n", "20 | \n", "Altenburger Land | \n", "88356.0 | \n", "Thüringen | \n", "
395411 rows × 8 columns
\n", "