From e9b70468f22c833da5744eed59112100dfe1de7c Mon Sep 17 00:00:00 2001 From: sasakar Date: Wed, 8 Jul 2026 17:49:19 +0300 Subject: [PATCH] Replace deprecated matplotlib and pandas API calls in notebook --- 1-Introduction/04-stats-and-probability/notebook.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/1-Introduction/04-stats-and-probability/notebook.ipynb b/1-Introduction/04-stats-and-probability/notebook.ipynb index 423404dc..47b39def 100644 --- a/1-Introduction/04-stats-and-probability/notebook.ipynb +++ b/1-Introduction/04-stats-and-probability/notebook.ipynb @@ -136,7 +136,7 @@ "outputs": [], "source": [ "plt.figure(figsize=(10,2))\n", - "plt.boxplot(df['Height'].ffill(), vert=False, showmeans=True)\n", + "plt.boxplot(df['Height'].ffill(), orientation='horizontal', showmeans=True)\n", "plt.grid(color='gray', linestyle='dotted')\n", "plt.tight_layout()\n", "plt.show()" @@ -272,7 +272,7 @@ " return m, h\n", "\n", "for p in [0.85, 0.9, 0.95]:\n", - " m, h = mean_confidence_interval(df['Weight'].fillna(method='pad'),p)\n", + " m, h = mean_confidence_interval(df['Weight'].ffill(),p)\n", " print(f\"p={p:.2f}, mean = {m:.2f} ± {h:.2f}\")" ] }, @@ -384,7 +384,7 @@ "metadata": {}, "outputs": [], "source": [ - "heights = df['Height'].fillna(method='pad')\n", + "heights = df['Height'].ffill()\n", "salaries = 1000+(heights-heights.min())/(heights.max()-heights.mean())*100\n", "print(list(zip(heights, salaries))[:10])" ] @@ -507,7 +507,7 @@ "metadata": {}, "outputs": [], "source": [ - "np.corrcoef(df['Height'].fillna(method='pad'), df['Weight'])" + "np.corrcoef(df['Height'].ffill(), df['Weight'])" ] }, {