From c2dbb2e1bfe8db523e3f3be52c71b8e1f6de39fd Mon Sep 17 00:00:00 2001 From: Achuan-2 Date: Wed, 1 Jul 2026 09:31:59 +0800 Subject: [PATCH] set ddof = 1 for computing sample standard deviation --- .../solutions/W0D1_Tutorial1_Solution_3c8e55c9.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/W0D1_PythonWorkshop1/solutions/W0D1_Tutorial1_Solution_3c8e55c9.py b/tutorials/W0D1_PythonWorkshop1/solutions/W0D1_Tutorial1_Solution_3c8e55c9.py index 883a3956..0297ca6e 100644 --- a/tutorials/W0D1_PythonWorkshop1/solutions/W0D1_Tutorial1_Solution_3c8e55c9.py +++ b/tutorials/W0D1_PythonWorkshop1/solutions/W0D1_Tutorial1_Solution_3c8e55c9.py @@ -19,7 +19,7 @@ v_mean = np.mean(v_n, axis=0) # Compute sample standard deviation (use np.std) -v_std = np.std(v_n, axis=0) +v_std = np.std(v_n, axis=0, ddof=1) # Plot figure with plt.xkcd(): @@ -36,4 +36,4 @@ plt.plot(t_range, v_mean-v_std, 'C7', alpha=0.8, label='mean $\pm$ std') plt.legend() - plt.show() \ No newline at end of file + plt.show()