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

Preliminaries


In [2]:
# Load library
import numpy as np

Create Row Vector


In [3]:
# Create a vector as a row
vector_row = np.array([1, 2, 3])

Create Column Vector


In [4]:
# Create a vector as a column
vector_column = np.array([[1],
                          [2],
                          [3]])


Out[4]:
2