data-processing-example/data-processing.ipynb

380 lines
142 KiB
Text
Raw Normal View History

2024-05-20 10:19:55 +00:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 207,
"metadata": {},
"outputs": [],
"source": [
"import pathlib\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"import matplotlib.dates as mdates\n",
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 208,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>STATIONS_ID</th>\n",
" <th>MESS_DATUM</th>\n",
" <th>QN_4</th>\n",
" <th>TT_TER</th>\n",
" <th>RF_TER</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>1939.0</td>\n",
" <td>1.939000e+03</td>\n",
" <td>1939.000000</td>\n",
" <td>1939.000000</td>\n",
" <td>1939.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>1443.0</td>\n",
" <td>2.023268e+09</td>\n",
" <td>5.121712</td>\n",
" <td>-1.439144</td>\n",
" <td>58.563177</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>0.0</td>\n",
" <td>5.373317e+05</td>\n",
" <td>3.262451</td>\n",
" <td>114.311663</td>\n",
" <td>122.156135</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>1443.0</td>\n",
" <td>2.022111e+09</td>\n",
" <td>1.000000</td>\n",
" <td>-999.000000</td>\n",
" <td>-999.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>1443.0</td>\n",
" <td>2.023042e+09</td>\n",
" <td>3.000000</td>\n",
" <td>6.200000</td>\n",
" <td>59.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>1443.0</td>\n",
" <td>2.023092e+09</td>\n",
" <td>3.000000</td>\n",
" <td>10.900000</td>\n",
" <td>74.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>1443.0</td>\n",
" <td>2.024012e+09</td>\n",
" <td>9.000000</td>\n",
" <td>16.600000</td>\n",
" <td>87.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
" <td>1443.0</td>\n",
" <td>2.024052e+09</td>\n",
" <td>9.000000</td>\n",
" <td>34.300000</td>\n",
" <td>100.000000</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" STATIONS_ID MESS_DATUM QN_4 TT_TER RF_TER\n",
"count 1939.0 1.939000e+03 1939.000000 1939.000000 1939.000000\n",
"mean 1443.0 2.023268e+09 5.121712 -1.439144 58.563177\n",
"std 0.0 5.373317e+05 3.262451 114.311663 122.156135\n",
"min 1443.0 2.022111e+09 1.000000 -999.000000 -999.000000\n",
"25% 1443.0 2.023042e+09 3.000000 6.200000 59.000000\n",
"50% 1443.0 2.023092e+09 3.000000 10.900000 74.000000\n",
"75% 1443.0 2.024012e+09 9.000000 16.600000 87.000000\n",
"max 1443.0 2.024052e+09 9.000000 34.300000 100.000000"
]
},
"execution_count": 208,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"datafile = pathlib.Path() / \"wetterdaten_freiburg_2022_2024.csv\"\n",
"\n",
"data = pd.read_csv(datafile, sep=\";\")\n",
"data.describe()"
]
},
{
"cell_type": "code",
"execution_count": 209,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>STATIONS_ID</th>\n",
" <th>MESS_DATUM</th>\n",
" <th>QN_4</th>\n",
" <th>TT_TER</th>\n",
" <th>RF_TER</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>1939.0</td>\n",
" <td>1939</td>\n",
" <td>1939.000000</td>\n",
" <td>1939.000000</td>\n",
" <td>1939.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>1443.0</td>\n",
" <td>2023-09-03 09:01:23.548220672</td>\n",
" <td>5.121712</td>\n",
" <td>-1.439144</td>\n",
" <td>58.563177</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>1443.0</td>\n",
" <td>2022-11-13 06:00:00</td>\n",
" <td>1.000000</td>\n",
" <td>-999.000000</td>\n",
" <td>-999.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>1443.0</td>\n",
" <td>2023-04-23 15:00:00</td>\n",
" <td>3.000000</td>\n",
" <td>6.200000</td>\n",
" <td>59.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>1443.0</td>\n",
" <td>2023-09-16 12:00:00</td>\n",
" <td>3.000000</td>\n",
" <td>10.900000</td>\n",
" <td>74.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>1443.0</td>\n",
" <td>2024-01-15 15:00:00</td>\n",
" <td>9.000000</td>\n",
" <td>16.600000</td>\n",
" <td>87.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
" <td>1443.0</td>\n",
" <td>2024-05-15 18:00:00</td>\n",
" <td>9.000000</td>\n",
" <td>34.300000</td>\n",
" <td>100.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>0.0</td>\n",
" <td>NaN</td>\n",
" <td>3.262451</td>\n",
" <td>114.311663</td>\n",
" <td>122.156135</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" STATIONS_ID MESS_DATUM QN_4 TT_TER \\\n",
"count 1939.0 1939 1939.000000 1939.000000 \n",
"mean 1443.0 2023-09-03 09:01:23.548220672 5.121712 -1.439144 \n",
"min 1443.0 2022-11-13 06:00:00 1.000000 -999.000000 \n",
"25% 1443.0 2023-04-23 15:00:00 3.000000 6.200000 \n",
"50% 1443.0 2023-09-16 12:00:00 3.000000 10.900000 \n",
"75% 1443.0 2024-01-15 15:00:00 9.000000 16.600000 \n",
"max 1443.0 2024-05-15 18:00:00 9.000000 34.300000 \n",
"std 0.0 NaN 3.262451 114.311663 \n",
"\n",
" RF_TER \n",
"count 1939.000000 \n",
"mean 58.563177 \n",
"min -999.000000 \n",
"25% 59.000000 \n",
"50% 74.000000 \n",
"75% 87.000000 \n",
"max 100.000000 \n",
"std 122.156135 "
]
},
"execution_count": 209,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data[\"MESS_DATUM\"] = pd.to_datetime(data[\"MESS_DATUM\"], format=\"%Y%m%d%H\")\n",
"data.describe()"
]
},
{
"cell_type": "code",
"execution_count": 210,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA90AAAGGCAYAAABmGOKbAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy80BEi2AAAACXBIWXMAAA9hAAAPYQGoP6dpAACLZElEQVR4nO3dd3gUVdsG8HvTNoUkBNIoSSD0hEAgtNDBSMCIYomFVwQERAQLIAiiFFFRaWJBxFcE/fQVwYaCQGgCEkWQIiX0JiGhJ0Ag9Xx/hB12s7vJBnYzczb377pywc7Mbp7ZzJkzz5kz5+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i8tLPoPt4uKCyMhIk2UNGzYEcKtLYHljqlu3rsXtfv/9d0yaNAmpqanIyckxWZeVlaXEaC/W4iAiIsf56KOP0LBhQ2RlZWHBggXYuHGjksgAxY9FCSHw2muv4bXXXrP4GWfPnkWtWrUsrjt58iQmTpyIZcuWmdVpt9uA27NnT/j7+2Px4sW46667ABR3LY+NjVXqxDuNW4scsU+GZ/dtmYO7du3aZol4QEAAdu/ebfPvM3bixAnUqFED3t7eJsvr169vcfsbN24gKSkJcXFx+Pbbb01GtD937hwuX76M+fPnY/78+RbfX/L6hyovJt1EkikqKkJwcDC++uori+uDgoJMXru6ulrcztpyUWKANEfEZGmE8CNHjuCuu+5C48aNMWvWLISFhcHDwwMrVqzA7NmzbZryw9ogJIWFhRaXc6RyIqKK16Z
"text/plain": [
"<Figure size 1000x400 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"data.drop([\"STATIONS_ID\", \"QN_4\", \"eor\"], axis=1, inplace=True)\n",
"\n",
"fig = plt.figure(figsize=(10, 4))\n",
"ax = plt.subplot(1, 2, 1)\n",
"ax.plot(data[\"MESS_DATUM\"], data[\"TT_TER\"])\n",
"ax.set_title(\"Temperatur\")\n",
"monthyearFmt = mdates.DateFormatter('%m-%Y')\n",
"ax.xaxis.set_major_formatter(monthyearFmt)\n",
"_ = plt.xticks(rotation=90)\n",
"\n",
"ax = plt.subplot(1, 2, 2)\n",
"ax.plot(data[\"MESS_DATUM\"], data[\"RF_TER\"])\n",
"ax.set_title(\"Relative Luftfeuchtigkeit\")\n",
"monthyearFmt = mdates.DateFormatter('%m-%Y')\n",
"ax.xaxis.set_major_formatter(monthyearFmt)\n",
"_ = plt.xticks(rotation=90)\n",
"\n",
"plt.tight_layout()\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 211,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA90AAAGGCAYAAABmGOKbAAAAOXRFWHRTb2Z0d2F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VERoqOjWTkYDAYjyBkyZAg6deoEAHj00UdRo0YNvP3221i8eDFGjx7t59K58KXwbxWXLl0CACQmJlqSPhAQCrn+hOO4oKhTDGth5uUMhg1xOp2YMWMGWrdujaioKCQlJeGJJ57A9evXRekaNmyIYcOGYfXq1ejUqROio6PRpk0bj2n6ggUL0KZNG0RFRaFjx47YtWuX6Hr3nqaTJ09i0KBBiImJQZ06dTB58mTwPG+oTMuWLfOU6ZNPPgEAzJkzB/369UOtWrUQGRmJVq1aYdasWV7XHzhwAGvWrPGYKfbp0wcA8Nprr4HjOK/35TZrPH36NFU5GAwGg+EbbrrpJgAuTauQw4cP44477kC1atUQFRWFTp06YfHixar5rVu3DnfeeSfq16+PyMhIpKSk4LnnnkNhYaEnzdixYzFz5kwA4i1dboR7uufPnw+O47BmzRqve33yySfgOA779+83XG4a5PawS/cM9+nTBw8++CAAoHPnzuA4DmPHjgXHccjPz8dXX33leeaxY8di7Nix6N27NwDgzjvvFI2rtM+kZfwFgD///BO9e/dGXFwc4uPj0blzZ3z//fde1x88eBB9+/ZFlSpVULduXUybNk30Pjp37gwAeOihhzzP5H4PpD3dV69exf3334/4+HgkJibiwQcfxJ49e6j2XO/evRs1a9ZEnz59kJeXBwC4cOECHn74YSQlJSEyMhKtW7fGl19+KbpO+n3U6h+jcsI03QyGDXniiScwd+5cPPTQQ3j22Wdx6tQpfPTRR9i1axc2bNggWt09fvw47rnnHjzxxBO477778M477+DWW2/F7Nmz8Z///AdPPfUUAGDq1KkYPXo0jhw5gpCQivU2h8OBwYMHo1u3bpg2bRqWLl2KV199FWVlZZg8ebKuMh05cgRjxozBE088gcceewzNmzcHAMyaNQutW7fGbbfdhrCwMPz222946qmn4HQ6MW7cOADAjBkz8MwzzyA2Nhb/93//BwBISkrS9R7lysFgMBgM3+AWxqpWreo5duDAAfTs2RN169bFSy+9hJiYGPz8888YMWIEfvnlF9x+++2y+c2bNw8FBQV48sknUb16dWzduhUffvghzp8/j3nz5gFwjVfp6enErVtShg4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ke0yJWDwWAwGNaQlpaGmjVrIiUlBXfccQdiYmKwePFi1KtXDwBw7do1/P333xg9ejRyc3M948nVq1cxaNAgHDt2TNHbuXAcyc/Px5UrV9CjRw/wPO+1hYqWu+66C5cuXRKZdc+fPx9OpxN33XWXKeW2I1Y80/Lly5Gbm4uXXnrJa5+z1MQ6NjZW5M8mIiICXbp0Ic5TaFi6dCnCw8Px2GOPeY6FhIR4LOlIrFq1CoMGDUL//v2xYMECREZGAnD5gfnll19w6623gud50dxn0KBByM7Oxs6dO3WVk1E5YeblDIbNOHbsGLKzs1GrVi3iebczFDdCwRoAEhISAAApKSnE49I92CEhIWjUqJHoWLNmzQBUmAVqLVNqaiox3YYNG/Dqq69i06ZNKCgoEJ3Lzs72lNEs5MrBYDAYDGuYOXMmmjVrhuzsbHz55ZdYu3atR5ABXFuieJ7HK6+8gldeeYWYx6VLl1C3bl3iubNnz2LSpElYvHix13imd/F28ODBSEhIwE8//YT+/fsDcJmWt2/f3jMeGi23HbHimdx792licNerV89LEK9atSr27t1LfT8hZ86cQe3atVGlShXR8SZNmhDTFxUVYejQoejYsSN+/vlnkUf7y5cvIysrC59++ik+/fRT4vXSuQ+DoQQTuhkMm+F0OlGrVi189913xPM
"text/plain": [
"<Figure size 1000x400 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Fehlerwerte vereinheitlichen\n",
"data.replace(-999, np.nan, inplace=True)\n",
"\n",
"# Fehlende Werte durch Interpolation ersetzen\n",
"data[\"TT_TER\"] = data[\"TT_TER\"].interpolate()\n",
"data[\"RF_TER\"] = data[\"RF_TER\"].interpolate()\n",
"\n",
"fig = plt.figure(figsize=(10, 4))\n",
"ax = plt.subplot(1, 2, 1)\n",
"ax.plot(data[\"MESS_DATUM\"], data[\"TT_TER\"])\n",
"ax.set_title(\"Temperatur\")\n",
"monthyearFmt = mdates.DateFormatter('%m-%Y')\n",
"ax.xaxis.set_major_formatter(monthyearFmt)\n",
"_ = plt.xticks(rotation=90)\n",
"\n",
"ax = plt.subplot(1, 2, 2)\n",
"ax.plot(data[\"MESS_DATUM\"], data[\"RF_TER\"])\n",
"ax.set_title(\"Relative Luftfeuchtigkeit\")\n",
"monthyearFmt = mdates.DateFormatter('%m-%Y')\n",
"ax.xaxis.set_major_formatter(monthyearFmt)\n",
"_ = plt.xticks(rotation=90)\n",
"\n",
"plt.tight_layout()\n",
"plt.show()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"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.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}