Question: 5 . 1 [ 2 pt ] Write a function called operations that takes as inputs a real number c and two vectors v and

5.1[2 pt] Write a function called operations that takes as inputs a real number c and two vectors v and w(represented as lists) and returns a dictionary that has eight key-value pairs:
shape: the shape of v(as a tuple)
scale: v scaled by c(as a numpy array)
addition: v plus w(as a numpy array)
subtraction: v minus w(as a numpy array)
dot: the dot product of v and w(as a float)
length: the norm of v(as a float)
as_one_long_vector: v and w stacked horizontally (as a numpy array)
as_rows: v and w stacked vertically like books lying in a pile a table (as a numpy array)
23]: def operations (c,v,w :
# YOUR CODE HERE
raise NotImplementedError()
 5.1[2 pt] Write a function called operations that takes as inputs

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!