From bd5b0e09172007da6f4cfaa38aa766966be3ee85 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauldmccarthy@gmail.com> Date: Fri, 2 Feb 2018 11:12:29 +0000 Subject: [PATCH] Clarification on vectors in numpy --- getting_started/04_numpy.ipynb | 10 ++++++++-- getting_started/04_numpy.md | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/getting_started/04_numpy.ipynb b/getting_started/04_numpy.ipynb index e877863..8c7f1d7 100644 --- a/getting_started/04_numpy.ipynb +++ b/getting_started/04_numpy.ipynb @@ -775,8 +775,14 @@ "source": [ "> Here we used a handy feature of the `reshape` method - if you pass `-1` for\n", "> the size of one dimension, it will automatically determine the size to use\n", - "> for that dimension. Take a look at [the\n", - "> appendix](#appendix-vectors-in-numpy) for a discussion on vectors in Numpy.\n", + "> for that dimension.\n", + "\n", + "\n", + "Note that Numpy treats row and column vectors differently than in Matlab,\n", + "which is a potential source of confusion for those of you who are used to\n", + "Matlab's linear algebra-based take on things. You might wish to take a break\n", + "now to read [the appendix](#appendix-vectors-in-numpy) for a discussion on\n", + "vectors in Numpy.\n", "\n", "\n", "Here is a more useful example, where we use broadcasting to de-mean the rows\n", diff --git a/getting_started/04_numpy.md b/getting_started/04_numpy.md index dce3532..a97a694 100644 --- a/getting_started/04_numpy.md +++ b/getting_started/04_numpy.md @@ -576,8 +576,14 @@ print(a * b.reshape(-1, 1)) > Here we used a handy feature of the `reshape` method - if you pass `-1` for > the size of one dimension, it will automatically determine the size to use -> for that dimension. Take a look at [the -> appendix](#appendix-vectors-in-numpy) for a discussion on vectors in Numpy. +> for that dimension. + + +Note that Numpy treats row and column vectors differently than in Matlab, +which is a potential source of confusion for those of you who are used to +Matlab's linear algebra-based take on things. You might wish to take a break +now to read [the appendix](#appendix-vectors-in-numpy) for a discussion on +vectors in Numpy. Here is a more useful example, where we use broadcasting to de-mean the rows -- GitLab