DATA MUNGING
DATA CLEANING PYTHON
MACHINE LEARNING RECIPES
PANDAS CHEATSHEET
ALL TAGS
# How to SUBTRACT numerical value to each element of a matrix?

# How to SUBTRACT numerical value to each element of a matrix?

This recipe helps you SUBTRACT numerical value to each element of a matrix

How do you do mathematical operation on a matrix i.e on the elements of matrix?

So this is the recipe on how we can subtract something to each electment of a matrix.

We have imported numpy which is needed.
```
import numpy as np
```

We have calculated a matrix on which we will perform operation.
```
matrixA = np.array([[2, 3, 23],
[5, 6, 25],
[8, 9, 28]])
```

We have made a function that will substract a number in this case 15 to every element of matrix. Finally we have printed the matrix.
```
add_100 = lambda i: i - 15
vectorized_add_100 = np.vectorize(add_100)
print(vectorized_add_100(matrixA))
```

So the output comes as

[[-13 -12 8] [-10 -9 10] [ -7 -6 13]]

In this data science project, we will predict the credit card fraud in the transactional dataset using some of the predictive models.

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.

In this data science project, you will work with German credit dataset using classification techniques like Decision Tree, Neural Networks etc to classify loan applications using R.

Data Science Project - Build a recommendation engine which will predict the products to be purchased by an Instacart consumer again.

In this ML Project, you will use the Avocado dataset to build a machine learning model to predict the average price of avocado which is continuous in nature based on region and varieties of avocado.

In this machine learning project you will work on creating a robust prediction model of Rossmann's daily sales using store, promotion, and competitor data.

Data Science Project in Python- Given his or her job role, predict employee access needs using amazon employee database.

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 NLP AI application, we build the core conversational engine for a chatbot. We use the popular NLTK text classification library to achieve this.

This data science in python project predicts if a loan should be given to an applicant or not. We predict if the customer is eligible for loan based on several factors like credit score and past history.