DATA MUNGING
DATA CLEANING PYTHON
MACHINE LEARNING RECIPES
PANDAS CHEATSHEET
ALL TAGS
# How to calculate dot product of two vectors?

# How to calculate dot product of two vectors?

This recipe helps you calculate dot product of two vectors

This data science python tutorial does the following: 1. Creating customized numpy vectors 2. Taking dot products of two vectors using different methods

In [1]:

```
## How to calculate dot product of two vectors
def Kickstarter_Example_14():
print()
print(format('How to calculate dot product of two vectors','*^72'))
# Load library
import numpy as np
# Create two vectors
vectorA = np.array([1,2,3])
vectorB = np.array([4,5,6])
# Calculate Dot Product (Method 1)
print(); print(np.dot(vectorA, vectorB))
# Calculate Dot Product (Method 2)
print(); print(vectorA @ vectorB)
Kickstarter_Example_14()
```

In [2]:

```
## How to calculate dot product of two matrices
def Kickstarter_Example_14_1():
print()
print(format('How to calculate dot product of two matrices','*^72'))
# Load library
import numpy as np
# Create two vectors
matrixA = np.array([[2, 3, 23],
[5, 6, 25],
[8, 9, 28]])
matrixB = np.array([[1, 2, 3],
[4, 5, 6],
[7, 8, 9]])
# Calculate Dot Product (Method 1)
print(); print(np.dot(matrixA, matrixB))
# Calculate Dot Product (Method 2)
print(); print(matrixA @ matrixB)
Kickstarter_Example_14_1()
```

In [3]:

```
## How to describe a matrix
def Kickstarter_Example_14_2():
print()
print(format('How to describe a matrix','*^72'))
# Load library
import numpy as np
# Create a matrix
matrixA = np.array([[2, 3, 23],
[5, 6, 25],
[8, 9, 28]])
# View number of rows and columns
print(); print("Shape: ", matrixA.shape)
# View number of elements (rows * columns)
print(); print("Size: ", matrixA.size)
# View number of dimensions
print(); print("Dimention: ", matrixA.ndim)
Kickstarter_Example_14_2()
```

In this deep learning project, you will build a classification system where to precisely identify human fitness activities.

Data Science Project in R-Predict the sales for each department using historical markdown data from the Walmart dataset containing data of 45 Walmart stores.

Deep Learning Project- Learn to apply deep learning paradigm to forecast univariate time series data.

In this machine learning project, you will uncover the predictive value in an uncertain world by using various artificial intelligence, machine learning, advanced regression and feature transformation techniques.

There are different time series forecasting methods to forecast stock price, demand etc. In this machine learning project, you will learn to determine which forecasting method to be used when and how to apply with time series forecasting example.

Text data requires special preparation before you can start using it for any machine learning project.In this ML project, you will learn about applying Machine Learning models to create classifiers and learn how to make sense of textual data.

In this ensemble machine learning project, we will predict what kind of claims an insurance company will get. This is implemented in python using ensemble machine learning algorithms.

Data Science Project in R -Build a machine learning algorithm to predict the future sale prices of homes.

This project analyzes a dataset containing ecommerce product reviews. The goal is to use machine learning models to perform sentiment analysis on product reviews and rank them based on relevance. Reviews play a key role in product recommendation systems.

The goal of this data science project is to build a predictive model and find out the sales of each product at a given Big Mart store.