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

This recipe helps you ADD numerical value to each element of a matrix using numpy in python

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
**

Use cluster analysis to identify the groups of characteristically similar schools in the College Scorecard dataset. Considerations: Clustering Algorithm Data Preparation How will you deal with missing values? Categorical variables? Feature intercorrelations? Feature normalization or scaling? Dimensionality reduction? Hyperparameters How will you set the parameters -- the algorithm's knobs and dials, so to speak -- in order to achieve valid and useful output? Interpretation Is it possible to explain what each cluster represents? Did you retain or prepare a set of features that enables a meaningful interpretation of the clusters? Do the compositions of the clusters seem to make sense? Validation How will you measure the validity of your clustering process? Which metrics will you use and how will you apply them?

In this data science project, you will learn how to perform market basket analysis with the application of Apriori and FP growth algorithms based on the concept of association rule learning.

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.

PySpark Project-Get a handle on using Python with Spark through this hands-on data processing spark python tutorial.

In this machine learning project, you will learn how to load, fine tune and evaluateT various transformer models for text classification tasks.

Use the Zillow dataset to follow a test-driven approach and build a regression machine learning model to predict the price of the house based on other variables.

FEAST Feature Store Example- Learn to use FEAST Feature Store to manage, store, and discover features for customer churn prediction machine learning project.

In this human activity recognition project, we use multiclass classification machine learning techniques to analyse fitness dataset from a smartphone tracker.

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.

In this time series project, you will build a model to predict the stock prices and identify the best time series forecasting model that gives reliable and authentic results for decision making.