# Difference - NumPy uFuncs (Python Tutorial)

This is a detailed tutorial of the NumPy Difference Universal Functions. Learn the usage of these functions with the help of examples.

This is a detailed tutorial of the NumPy Difference Universal Functions. Learn the usage of these functions with the help of examples.

### NumPy Difference

When we are trying to find the difference between two values, we are actually subtracting them from each other. When we subtract these two values, we get the difference between them. So we get a discrete difference by subtracting two successive elements with each other.

And in order to find the difference between the values, we use `diff()` the function. so let us take an example to understand it better:

So here in result, we are getting [2 2 2] which is because of 3-1=2, 5-3=2 and 7-3=2. So this is how we get the discrete difference between the values. Let us take another example :

Here in this example, we are getting the output as [1 5 6] because 3-2=1, 8-3=5 and 14-8=6.

We can aloe perform the operation of difference for n number of times. We can do this by giving parameter. `n`.

Let us take an example to understand it better:

So here in this example, we have given a parameter n which defines that the difference will be taken two times. So when the difference is to take for the first time, we get [2 2 2] which is because of 3-1=2, 5-3=2 and 7-3=2. But the second time we get [0 0] because 2-2=0 and 2-2=0 . So we can have n number of differences to get our results.

## Products - NumPy uFuncs (Python Tutorial) - WTMatter

Products - NumPy uFuncs (Python Tutorial): This is a detailed tutorial of the NumPy Products Universal Functions. Learn the usage of these functions with the help of examples.

## Simple Arithmetic - NumPy uFuncs (Python Tutorial) - WTMatter

This is a detailed tutorial of the NumPy Simple Arithmetic Universal Functions. Learn the usage of these functions with the help of examples.

## Rounding Decimals - NumPy uFuncs (Python Tutorial) - WTMatter

This is a detailed tutorial of the NumPy Rounding Decimals Universal Functions. Learn the usage of these functions with the help of examples.

## LCM - NumPy uFuncs - WTMatter

LCM - NumPy uFuncs - WTMatter: This is a detailed tutorial of the NumPy LCM Universal Functions. Learn the usage of these functions with the help of examples.

## Set Operations – NumPy uFuncs

Set Operations – NumPy uFuncs: This is a detailed tutorial of the NumPy Set Operations Universal Functions. Learn the usage of these functions with the help of examples.
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}