BaşlayınÜcretsiz Başlayın

Computing dot product

In this exercise, we will learn to compute the dot product between two vectors, A = (1, 3) and B = (-2, 2), using the numpy library. More specifically, we will use the np.dot() function to compute the dot product of two numpy arrays.

Bu egzersiz

Feature Engineering for NLP in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Initialize A (1,3) and B (-2,2) as numpy arrays using np.array().
  • Compute the dot product using np.dot() and passing A and B as arguments.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Initialize numpy vectors
A = ____.____([____,____])
B = ____.____([____,____])

# Compute dot product
dot_prod = ____.____(____, ____)

# Print dot product
print(dot_prod)
Kodu Düzenle ve Çalıştır