Skip to content

Instantly share code, notes, and snippets.

@tommydangerous
Created June 17, 2021 05:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommydangerous/fb5b5117112991de1121e2eda0ad0352 to your computer and use it in GitHub Desktop.
Save tommydangerous/fb5b5117112991de1121e2eda0ad0352 to your computer and use it in GitHub Desktop.
create_vectors.py
# Load Numpy module
import numpy as np
# Creating a 1-D list (horizontal)
list1 = [2, 3, 5]
# Creating a 1-D list (vertical)
list2 = [
[20],
[30],
[50],
]
# Vector as row
vector1 = np.array(list1)
# Vector as column
vector2 = np.array(list2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment