NumPy | Python Methods and Functions

Using the

method we can subtract a specific value that is provided as a parameter in the **numpy.ndarray.__isub__()** ` ndarray .__ isub __ () . The value will be `

** subtracted ** to each item in the numpy array.

` ` ** Syntax: ** ndarray .__ isub __ ($ self, value, /)

** Return: ** self- = value

** Example # 1: **

In this example, we see that each the array element ** is subtracted ** with the value specified as a parameter in the ` ndarray .__ isub __ () `

method. Remember that this method will work for every type of numeric value.

` # import important module into python `

` import `

` numpy as np `

` # make an array with NumPy `

` gfg `

` = `

` np.array ([`

` 1.2 `

`, `

` 2.6 `

`, `

` 3 `

`, `

` 4.5 `

`, `

` 5 `

`]) `

` # applying the ndarray .__ isub __ () method `

` print `

` (gfg .__ isub __ (`

` 5 `

`)) `

` `

** Exit:**

[-3.8 -2.4 -2. -0.5 0.]

** Example # 2: **

` ` |

** Exit:**

[[-2. -0.8 0. 1. 2.01] [3.1 2. 1.8 0. -1. ]]

Target knows. Apple Computer knows, too. So do LinkedIn, Netflix, Facebook, Twitter, Expedia, national and local political campaigns, and dozens of other organizations that all generate enormous eco...

10/07/2020

IRMA is a research-based professional organization dedicated to advancing the concepts and practices of information resource management in modern organizations. The primary purpose of IRMA is to promo...

28/08/2021

Deep Learning for Coders with fastai and PyTorch: AI Applications Without a PhD. Deep learning is often seen as the exclusive domain of math PhDs and big tech companies. But as this how-to guide sh...

05/09/2021

This is the first book on synthetic data for deep learning, and its extensive coverage could make this book the standard benchmark for synthetic data for years to come. The book can also serve as an i...

28/08/2021

X
# Submit new EBook