C1_W3_Lab_Vector Operations: Scalar Multiplication, Sum and Dot Product of Vectors

For the lab mentioned in the subject line, there is this code involving matplotlib like below.

My question: is knowledge of Python and Matplotlib assumed while taking Linear Algebra for ML and Data Science?

import matplotlib.pyplot as plt

def plot_vectors(list_v, list_label, list_color):
_, ax = plt.subplots(figsize=(10, 10))
ax.tick_params(axis=‘x’, labelsize=14)
ax.tick_params(axis=‘y’, labelsize=14)
ax.set_xticks(np.arange(-10, 10))
ax.set_yticks(np.arange(-10, 10))

plt.axis([-10, 10, -10, 10])
for i, v in enumerate(list_v):
    sgn = 0.4 * np.array([[1] if i==0 else [i] for i in np.sign(v)])
    plt.quiver(v[0], v[1], color=list_color[i], angles='xy', scale_units='xy', scale=1)
    ax.text(v[0]-0.2+sgn[0], v[1]-0.2+sgn[1], list_label[i], fontsize=14, color=list_color[i])

plt.grid()
plt.gca().set_aspect("equal")
plt.show()

v = np.array([[1],[3]])

Arguments: list of vectors as NumPy arrays, labels, colors.

plot_vectors([v], [f"v"], [“black”])

Hi @Hartej_Dhiman ,

Python and matplotlib are used in machine learning code. There are lots of online resources on Python programming for machine learning, so if you are not familiar with Python, you can do both this course and Python on parallel. Matplotlib is a set of functions for creating statistics, animated and interactive display for visualization purposes.

This is a thread from the MLS specialization learning resource forum, have a look at the suggestions on learning Python.