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

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

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

Have you tried to add a constant element in a matrix?

So this is the recipe on how we can add a constant to each element of a matrix.

```
import numpy as np
```

We have only imported numpy which is needed.

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

We have made a lambda function to add 100 in every value of matrix. We have created an object to add 100 in the vector form of matrix.
```
add_100 = lambda i: i + 100
vectorized_add_100 = np.vectorize(add_100)
print(vectorized_add_100(matrixA))
```

So the output comes as

[[102 103 123] [105 106 125] [108 109 128]]

**
Download Materials
**

In this Deep Learning Project on Image Segmentation Python, you will learn how to implement the Mask R-CNN model for early fire detection.

In this machine learning churn project, we implement a churn prediction model in python using ensemble techniques.

In this deep learning project, you will find similar images (lookalikes) using deep learning and locality sensitive hashing to find customers who are most likely to click on an ad.

Use the Amazon Reviews/Ratings dataset of 2 Million records to build a recommender system using memory-based collaborative filtering in Python.

In this data science project, you will predict borrowers chance of defaulting on credit loans by building a credit score prediction model.

Use the Adult Income dataset to predict whether income exceeds 50K yr based on
census data.

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.

Music Recommendation Project using Machine Learning - Use the KKBox dataset to predict the chances of a user listening to a song again after their very first noticeable listening event.

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.

In this R data science project, we will explore wine dataset to assess red wine quality. The objective of this data science project is to explore which chemical properties will influence the quality of red wines.