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

# How to Divide each element of a matrix by a numerical value?

This recipe helps you Divide each element of a matrix by a numerical value

Have to tried to do any mathematical function on all the values of a feature. Doing it manually may be a hectic work.

So this is the recipe on how we can divide each element of a matrix by a numerical value.

```
import numpy as np
```

We have only imported numpy which is needed.

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

First we have created a lambda function which is just like loop as it will iterate the function assined to it to the all elements. Then we have converted the martix into a vector form and finally we have passed the matrix in the function.
```
add_100 = lambda i: i / 9
vectorized_add_100 = np.vectorize(add_100)
print(vectorized_add_100(matrixA))
```

So the output comes as

[[0.22222222 0.33333333 2.55555556] [0.55555556 0.66666667 2.77777778] [0.88888889 1. 3.11111111]]

In this machine learning project, we will use binary leaf images and extracted features, including shape, margin, and texture to accurately identify plant species using different benchmark classification techniques.

Machine Learning Project in R- Predict the customer churn of telecom sector and find out the key drivers that lead to churn. Learn how the logistic regression model using R can be used to identify the customer churn in telecom dataset.

In this machine learning resume parser example we use the popular Spacy NLP python library for OCR and text classification.

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

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

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

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

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.

In this project, we are going to work on Deep Learning using H2O to predict Census income.