# To denote a training example should I use row vector or column vector?

This code accesses the first 3 examples in the iris data set,

from sklearn.datasets import load_iris
print(iris.data[:3])


and gives

[[5.1 3.5 1.4 0.2]
[4.9 3.  1.4 0.2]
[4.7 3.2 1.3 0.2]]


To denote the first example, $$x_1$$, should I use a column vector like

$$\begin{bmatrix} 5.1\\3.5\\1.4\\0.2 \end{bmatrix}$$

or a row vector like the following?

$$[5.1 \ 3.5 \ 1.4 \ 0.2]$$

Andrew Ng suggests putting examples in columns

while typical relational databases putting examples in rows.

I'd just like to know the pros and cons of different notations so that I can decide which one I would follow.

• Hello. What do you mean by "to denote a training example..."? Are you writing e.g. a paper or a homework and you don't know which notation you should use or maybe something else? – nbro Jun 14 at 1:50
• @nbro Thank you. I'd just like to know the pros and cons of different notations so that I can decide which one I would follow. – JJJohn Jun 18 at 9:35