How to Create a Vector or Matrix in Python?

This recipe helps you Create a Vector or Matrix in Python
In [1]:
## How to Create & Transpose a Vector or Matrix
def Kickstarter_Example_1():
    print()
    print(format('How to Create/Transpose a Vector and/or Matrix', '*^75'))

    # Load library
    import numpy as np

    # Create vector
    vector = np.array([1, 2, 3, 4, 5, 6])
    print()
    print("Original Vector: \n", vector)
    # Tranpose vector
    V = vector.T
    print("Transpose Vector: \n", V)

    # Create matrix
    matrix = np.array([[1, 2, 3],
                   [4, 5, 6],
                   [7, 8, 9]])
    print()
    print("Original Matrix: \n", matrix)
    # Transpose matrix
    M = matrix.T
    print("Transpose Matrix: \n", M)

Kickstarter_Example_1()
**************How to Create/Transpose a Vector and/or Matrix***************

Original Vector:
 [1 2 3 4 5 6]
Transpose Vector:
 [1 2 3 4 5 6]

Original Matrix:
 [[1 2 3]
 [4 5 6]
 [7 8 9]]
Transpose Matrix:
 [[1 4 7]
 [2 5 8]
 [3 6 9]]