# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     name: python3
# ---

# + [markdown] id="view-in-github" colab_type="text"
# <a href="https://colab.research.google.com/github/roneljr/Linear-Algebra-58019/blob/main/Vectors.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>

# + [markdown] id="g4_H6dxc41SG"
# Matrix Algebra

# + colab={"base_uri": "https://localhost:8080/"} id="Y_H23hju4zNy" outputId="fd1a658b-b0cc-40fe-d049-b34c4c4b3fba"
#numpy
import numpy as np
a = np.array([1,2,3]) #This is an example of 1x3 matrix
print(a)

# + colab={"base_uri": "https://localhost:8080/"} id="4apBmsLw5FgQ" outputId="11fd62a8-5c00-4465-84ba-7f9ba5ad2c79"
import numpy as np
b = np.array (([1,2,3],[4,5,6])) #This is a 2x3 matrix
print(b)

# + colab={"base_uri": "https://localhost:8080/"} id="Ag9vp0Za5Jh0" outputId="1899fde0-6c5c-4306-b2fd-79baa85a6f66"
import numpy as np
c = np.array([[1,2,3],[4,5,6],[7,8,9]]) #This is an example of 3x3 matrix
print(c)

# + colab={"base_uri": "https://localhost:8080/"} id="cugzlrj05jN1" outputId="c354ed47-4703-4058-bf2e-97e704eb3d11"
import numpy as np
d = np.full ((3,3),7)  
print(d)

# + colab={"base_uri": "https://localhost:8080/"} id="48ufys9R52lL" outputId="2c57a00c-bfea-4007-9ed6-3fc30f5dc422"
import numpy as np
e = np.array ([[1,2,3],[4,5,6],[7,8,9]])
print(e)
e = np.diagonal ([[1,2,3],[4,5,6],[7,8,9]])
print(e)

# + colab={"base_uri": "https://localhost:8080/"} id="cXuHfgmP6bLZ" outputId="fc4a49e9-4211-4c86-dd22-5c8947bfed16"
import numpy as np
f=np.eye(3)
print(f)

# + colab={"base_uri": "https://localhost:8080/"} id="mVWWmJTz6msX" outputId="a740b66b-d94e-49ca-dc85-fb0715382976"
import numpy as np
g = np.zeros((3,3))
print(g)

# + colab={"base_uri": "https://localhost:8080/"} id="yCUTc7Lx61W_" outputId="174be243-2cd4-411a-8649-b233f3b1eca7"
import numpy as np
h = np.empty((0,12))
print(h)

# + colab={"base_uri": "https://localhost:8080/"} id="CwXQmULh7FAC" outputId="27121a3a-8074-4d99-ed8e-4a9131b57ece"
import numpy as np
d = np.full ((3,3),7)
print(d+d)

# + colab={"base_uri": "https://localhost:8080/"} id="Cu_AaKTb7WWW" outputId="717f1452-a46d-4d7d-97be-099a501d1ebd"
import numpy as np
d = np.full ((3,3),7)
print(d-d)

StarcoderdataJupyterScriptsDedupFiltered