DATA MUNGING
DATA CLEANING PYTHON
MACHINE LEARNING RECIPES
PANDAS CHEATSHEET
ALL TAGS
# How to add and subtract between matrices using numpy in python

This recipe helps you add and subtract between matrices using numpy in python

Have you tried to add or substract matrices in python?

So this is the recipe on how we can add and subtract between matrices.

```
import numpy as np
```

We have only imported numpy which is needed.

We have created two matrices on which we will perform operations.
```
matrixA = np.array([[2, 3, 23],
[5, 6, 25],
[8, 9, 28]])
matrixB = np.array([[1, 2, 3],
[4, 5, 6],
[7, 8, 9]])
```

First we are adding the two matrices using the numpy function np.add. After that we are performing substraction by using the numpy function np.subtract, in both the function we have passed the matrices.
```
print(np.add(matrixA, matrixB))
print(np.subtract(matrixA, matrixB))
```

So the output comes as

[[ 3 5 26] [ 9 11 31] [15 17 37]] [[ 1 1 20] [ 1 1 19] [ 1 1 19]]

**
Download Materials
**

In this NLP Project, you will learn how to use the popular topic modelling library Gensim for implementing two state-of-the-art word embedding methods Word2Vec and FastText models.

Build your own image similarity application using Python to search and find images of products that are similar to any given product. You will implement the K-Nearest Neighbor algorithm to find products with maximum similarity.

In this data science project in R, we are going to talk about subjective segmentation which is a clustering technique to find out product bundles in sales data.

Given big data at taxi service (ride-hailing) i.e. OLA, you will learn multi-step time series forecasting and clustering with Mini-Batch K-means Algorithm on geospatial data to predict future ride requests for a particular region at a given time.

Build a time series ARIMA model in Python to forecast the use of arrival rate density to support staffing decisions at call centres.

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.

Identifying the ROI on marketing campaigns is an essential KPI for any business. In this ML project, you will learn to build a Multi Touch Attribution Model in Python to identify the ROI of various marketing efforts and their impact on conversions or sales..

In this deep learning project, you will learn how to build your custom OCR (optical character recognition) from scratch by using Google Tesseract and YOLO to read the text from any images.

Want to search images of clothes which have text on them? Then this project talks through how we can classify an image whether it has text on it or not. For this we use state of the model called as inception and try and deepdive into how it works on our dataset

In this data science project, you will contextualize customer data and predict the likelihood a customer will stay at 100 different hotel groups.