diff --git a/data-processing/notebooks/04_prepare_tabular_data.ipynb b/data-processing/notebooks/04_prepare_tabular_data.ipynb index 0559f32..ee07e96 100644 --- a/data-processing/notebooks/04_prepare_tabular_data.ipynb +++ b/data-processing/notebooks/04_prepare_tabular_data.ipynb @@ -80,7 +80,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -151,29 +151,29 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "{'Agricultural drought exposure': ,\n", - " 'Agricultural drought hazard': ,\n", - " 'Boundaries': ,\n", - " 'Contextual layers': ,\n", - " 'EO-based flood exposure': ,\n", - " 'EO-based flood hazard': ,\n", - " 'Hydrographic data': ,\n", - " 'Hydrometeorological Data': ,\n", - " 'In-situ Data': ,\n", - " 'Meteorological drought exposure': ,\n", - " 'Meteorological drought hazard': ,\n", - " 'Model-based flood exposure': ,\n", - " 'Model-based flood hazard': ,\n", - " 'Populated infrastructures': ,\n", - " 'Transportation Network Infrastructures': ,\n", - " 'Water-related infrastructures': }\n" + "{'Agricultural drought exposure': ,\n", + " 'Agricultural drought hazard': ,\n", + " 'Boundaries': ,\n", + " 'Contextual layers': ,\n", + " 'EO-based flood exposure': ,\n", + " 'EO-based flood hazard': ,\n", + " 'Hydrographic data': ,\n", + " 'Hydrometeorological Data': ,\n", + " 'In-situ Data': ,\n", + " 'Meteorological drought exposure': ,\n", + " 'Meteorological drought hazard': ,\n", + " 'Model-based flood exposure': ,\n", + " 'Model-based flood hazard': ,\n", + " 'Populated infrastructures': ,\n", + " 'Transportation Network Infrastructures': ,\n", + " 'Water-related infrastructures': }\n" ] } ], @@ -191,20 +191,20 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "{'Administrative Boundaries - adm0': ,\n", - " 'Administrative Boundaries - adm1': ,\n", - " 'Administrative Boundaries - adm2': ,\n", - " 'Administrative Boundaries - adm3': ,\n", - " 'Hydrological Basins': }" + "{'Administrative Boundaries - adm0': ,\n", + " 'Administrative Boundaries - adm1': ,\n", + " 'Administrative Boundaries - adm2': ,\n", + " 'Administrative Boundaries - adm3': ,\n", + " 'Hydrological Basins': }" ] }, - "execution_count": 4, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -335,7 +335,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -352,7 +352,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -408,13 +408,14 @@ "\n", " for _index, row in df.iterrows():\n", " code = str(row[code_column])\n", + " y_values = convert_string_to_float_list(row[\"y_axis_values\"])\n", "\n", " chart_data = {\n", " \"id\": chart_id,\n", " \"location_code\": str(row[code_column]),\n", " \"year\": int(row[\"year\"]),\n", " \"x_values\": literal_eval(row[\"x_axis_values\"]),\n", - " \"y_values\": convert_string_to_float_list(row[\"y_axis_values\"]),\n", + " \"y_values\": [None if math.isnan(value) else value for value in y_values],\n", " \"createdAt\": datetime.now().isoformat(),\n", " \"updatedAt\": datetime.now().isoformat(),\n", " \"layer\": layer_id,\n",