Programming: Linear Transformations and Neural Networks

When I run the lab such type off errors occur. Any would like to resolve it.


NameError Traceback (most recent call last)
in
----> 1 w3_unittest.test_T_stretch(T_stretch)

~/work/w3_unittest.py in test_T_stretch(target)
50 for test_case in test_cases:
51
—> 52 result = target(**test_case[‘input’])
53
54 try:

in T_stretch(a, v)
15 ### START CODE HERE ###
16 # Define the transformation matrix
—> 17 T = np.array([[a,0], [0,a]])
18
19 # Compute the transformation

NameError: name ‘np’ is not defined

Dont forget to run the cell where the line:

import numpy as np

is written? :slight_smile:

2 Likes