From aabd7a189592cf210632c45e8136565e19d09f35 Mon Sep 17 00:00:00 2001 From: Simone Primarosa Date: Tue, 3 Dec 2019 11:32:43 +0000 Subject: [PATCH] Fix out-of-scope variable usage --- coursework3.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coursework3.ipynb b/coursework3.ipynb index 829601a..b1aa536 100644 --- a/coursework3.ipynb +++ b/coursework3.ipynb @@ -158,7 +158,7 @@ " .groupby(['doc_class', 'word_id']) \\\n", " ['count'].apply(sum) \\\n", " .unstack(fill_value=0)\n", - " occurrences = np.zeros((K, len(V)))\n", + " occurrences = np.zeros((K, W))\n", " occurrences[x.index.values.reshape((-1,1)), x.columns.values] = x\n", " word_count = np.sum(occurrences, axis=1)\n", " \n",