
上QQ阅读APP看书,第一时间看更新
Vectors
Vectors are one-dimensional arrays of integers. Geometrically, they store the direction and magnitude of change from a point. We'll see how this works in machine learning algorithms when we discuss principal component analysis (PCA) in the next few pages. Vectors in Python are created as numpy array objects:
my_vector = np.array([5,6])
Vectors can be written in several ways:
