NumPy Tutorial NumPy Statistics NumPy References

NumPy - conj() function



The NumPy conj() function returns the complex conjugate, element-wise. The syntax for using this function is given below:

Syntax

numpy.conj(x, out=None)

Parameters

x Required. Specify the input array.
out Optional. Specify a location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned.

Return Value

Returns complex conjugate of x, element-wise.

Example:

The example below shows the usage of conj() function.

import numpy as np

Arr = np.array([[1+2j,2+4j],
                [3+6j,4+8j]])

print("Arr is:")
print(Arr)

#complex conjugate of Arr
print("\nComplex conjugate of Arr is:")
print(np.conj(Arr))

The output of the above code will be:

Arr is:
[[1.+2.j 2.+4.j]
 [3.+6.j 4.+8.j]]

Complex conjugate of Arr is:
[[1.-2.j 2.-4.j]
 [3.-6.j 4.-8.j]]

❮ NumPy - Functions