With the Numpy numpy.ndarray .__ xor __ ()
method we can get XOR elements by the value that is provided as a parameter in numpy.ndarray .__ xor __ ()
.
Syntax: ndarray .__ xor __ ($ self, value, /)
Return: self ^ value
Example # 1:
In this example, we see that each element has a value xor by value that is passed as a parameter to ndarray .__ xor __ ()
.
# import important module in python
import
numpy as np
# make an array with NumPy
gfg
= np.array ([
1
,
2
,
3
,
4
,
5
])
# applying the ndarray .__ xor __ () method
print
(gfg .__ xor __ (
2
))
Exit:
[3 0 1 6 7]
Example # 2:

Exit:
[[0 3 2 5 4] [7 4 5 2 3 ]]
Systems programming provides the basis for global calculation. Developing performancesensitive code requires a programming language that allows programmers to control the use of memory, processor tim...
23/09/2021
The field of Artificial Intelligence (AI), which can definitely be considered to be the parent field of deep learning, has a rich history going back to 1950. While we will not cover this history in mu...
23/09/2020
Managing and analyzing data have always offered the greatest benefits and the greatest challenges for organizations of all sizes and across all industries. Businesses have long struggled with finding ...
10/07/2020
The rate at which we produce data is growing steadily, thus creating even larger streams of continuously evolving data. Online news, microblogs, search queries are just a few examples of these contin...
10/07/2020