How to add and subtract between matrices?
DATA MUNGING DATA CLEANING PYTHON MACHINE LEARNING RECIPES PANDAS CHEATSHEET     ALL TAGS

How to add and subtract between matrices?

How to add and subtract between matrices?

This recipe helps you add and subtract between matrices

0
In [1]:
## How to add and subtract between matrices
def Kickstarter_Example_19():
    print()
    print(format('How to add and subtract between matrices', '*^72'))

    # Load library
    import numpy as np

    # Create two vectors
    matrixA = np.array([[2, 3, 23],
                       [5, 6, 25],
                       [8, 9, 28]])
    matrixB = np.array([[1, 2, 3],
                       [4, 5, 6],
                       [7, 8, 9]])
    # Add two matrices
    print(); print(np.add(matrixA, matrixB))

    # Subtract two matrices
    print(); print(np.subtract(matrixA, matrixB))

Kickstarter_Example_19()
****************How to add and subtract between matrices****************

[[ 3  5 26]
 [ 9 11 31]
 [15 17 37]]

[[ 1  1 20]
 [ 1  1 19]
 [ 1  1 19]]

Relevant Projects

Mercari Price Suggestion Challenge Data Science Project
Data Science Project in Python- Build a machine learning algorithm that automatically suggests the right product prices.

Sequence Classification with LSTM RNN in Python with Keras
In this project, we are going to work on Sequence to Sequence Prediction using IMDB Movie Review Dataset​ using Keras in Python.

Build an Image Classifier for Plant Species Identification
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.

Solving Multiple Classification use cases Using H2O
In this project, we are going to talk about H2O and functionality in terms of building Machine Learning models.

Zillow’s Home Value Prediction (Zestimate)
Data Science Project in R -Build a machine learning algorithm to predict the future sale prices of homes.

Music Recommendation System Project using Python and R
Machine Learning Project - Work with KKBOX's Music Recommendation System dataset to build the best music recommendation engine.

Choosing the right Time Series Forecasting Methods
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.

Credit Card Fraud Detection as a Classification Problem
In this data science project, we will predict the credit card fraud in the transactional dataset using some of the predictive models.

Data Science Project on Wine Quality Prediction in R
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.

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