diff --git a/exercises/Pandas_WeatherData/WeatherData_Analysis_tasks.ipynb b/exercises/Pandas_WeatherData/WeatherData_Analysis_tasks.ipynb index 2c43dd1d9732148221b00cd35531906909c14e3c..698ce0d7c27e238d47de7a6d48550dbc0f7bd43f 100644 --- a/exercises/Pandas_WeatherData/WeatherData_Analysis_tasks.ipynb +++ b/exercises/Pandas_WeatherData/WeatherData_Analysis_tasks.ipynb @@ -107,14 +107,6 @@ "After having imported the data gather some `info`rmation on the data (e.g. datatypes of columns or memory usage)." ] }, - { - "cell_type": "code", - "execution_count": null, - "id": "ff8e949d", - "metadata": {}, - "outputs": [], - "source": [] - }, { "cell_type": "markdown", "id": "06461f7c", @@ -351,9 +343,7 @@ "id": "ceaaacae", "metadata": {}, "outputs": [], - "source": [ - "grouped_by_month = df_weather_tweaked.groupby(df_weather_tweaked.index.month)" - ] + "source": [] }, { "cell_type": "markdown", @@ -369,30 +359,7 @@ "id": "b9251d7e", "metadata": {}, "outputs": [], - "source": [ - "fig, (ax1, ax2) = plt.subplots(2, 1, figsize=(6, 6), sharex=\"col\")\n", - "\n", - "ax2.set_xticks( range(1, 13 ) )\n", - "ax2.set_xlabel(\"month\")\n", - "\n", - "ax1.set_ylabel(\"Temperature / degree Celsius\")\n", - "ax1.violinplot(\n", - " [\n", - " df[\"Temperature\"]\n", - " for _, df in grouped_by_month \n", - " ]\n", - ");\n", - "ax2.set_ylabel(\"Relative Humidity /% \")\n", - "ax2.violinplot(\n", - " [\n", - " df[\"Humidity\"]\n", - " for _, df in grouped_by_month \n", - " ]\n", - ");\n", - "\n", - "\n", - "\n" - ] + "source": [] }, { "cell_type": "markdown", @@ -442,22 +409,6 @@ "metadata": {}, "outputs": [], "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a9e943ec", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c62bbfcd", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/slides/Day2_PandasDataFrames.ipynb b/slides/Day2_PandasDataFrames.ipynb index 38a5542c2c4bde2b18ecd6390dbaf26e9f5da85c..288ef4f76211849868b2ac8055e7f3dfe237e890 100644 --- a/slides/Day2_PandasDataFrames.ipynb +++ b/slides/Day2_PandasDataFrames.ipynb @@ -2213,11 +2213,7 @@ "id": "53d45569", "metadata": {}, "outputs": [], - "source": [ - "cols=[\"sepal length\",\"sepal width\",\"petal length\",\"petal width\"]\n", - "df_agg= df.loc[:,cols].agg([np.min, np.max, np.mean, np.std])\n", - "df_agg" - ] + "source": [] }, { "cell_type": "markdown", @@ -2233,10 +2229,7 @@ "id": "52a96d54", "metadata": {}, "outputs": [], - "source": [ - "df.loc[:,cols] =((df.loc[:,cols] - df_agg.loc['mean',:] )/ df_agg.loc['std',:])\n", - "df.describe()" - ] + "source": [] }, { "cell_type": "markdown", @@ -2270,9 +2263,7 @@ "id": "801dd946", "metadata": {}, "outputs": [], - "source": [ - "grouped_by_species = df.groupby(by=[\"Name\"])" - ] + "source": [] }, { "cell_type": "code", @@ -2280,12 +2271,7 @@ "id": "90b8c49e", "metadata": {}, "outputs": [], - "source": [ - "fig, axs = plt.subplots(1,3)\n", - "for ax, (name, group_data) in zip(axs,grouped_by_species): \n", - " group_data.boxplot(ax=ax)\n", - " ax.set_title(name)" - ] + "source": [] }, { "cell_type": "code", @@ -2299,7 +2285,7 @@ "metadata": { "celltoolbar": "Slideshow", "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" },