I'm a new learner in the Python language. When a new vector is generated, is it a column or row vector by default?
import numpy as np
theta = np.arange(3)
a = len(theta.T)
b = len(theta)
print('theta = {} \n theta.T = {}'.format(theta,theta.T))
c = theta.T.dot(theta)
d = theta.dot(theta.T)
It turns out a == b == 3
, c == d
, and both theta
and theta.T
are displayed as a row vector.
But this matters when I want to calculate the derivative of of symbolic function x · xT with x a row vector.