Title: Create A Vector
Slug: create_a_vector
Summary: How to create a vector in Python.
Date: 2017-09-02 12:00
Category: Machine Learning
Tags: Vectors Matrices Arrays
Authors: Chris Albon
In [2]:
# Load library
import numpy as np
In [3]:
# Create a vector as a row
vector_row = np.array([1, 2, 3])
In [4]:
# Create a vector as a column
vector_column = np.array([[1],
[2],
[3]])
Out[4]: