Dot Product and Vector Length
~8 mincode completion
Implement dot_and_lengths(a, b) returning the array [a . b, |a|, |b|].
Where this shows up
~8 min
••••••••••••••••
8 employers weight this skill
4 quant funds, 2 defense companies, 2 autonomy companies. Top match scores 93.
Python
import numpy as np
def dot_and_lengths(a, b):
"""
The dot product of two vectors and the length of each.
Args:
a: vector of d numbers
b: vector of d numbers
Returns:
array [a . b, |a|, |b|]
"""
# YOUR CODE HERE
pass