Python Forum
Bitwise Operations in numpy
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bitwise Operations in numpy
#1
Hi all
I am learning Numpy class they said bitwise operations but did not understand how the out put come like this

import numpy as np
a = np.array([1,2,3,4])
b = np.array([5,6,7,8])

print("a & b :",a&b)

Output

a & b : [1 2 3 0]

My doubt : What is the use of bitwise operators
How I got [1 2 3 0] this output
Reply


Messages In This Thread
Bitwise Operations in numpy - by Sowmya - Apr-03-2024, 12:44 PM
RE: Bitwise Operations in numpy - by deanhystad - Apr-03-2024, 12:59 PM
RE: Bitwise Operations in numpy - by Sowmya - Apr-03-2024, 02:36 PM
RE: Bitwise Operations in numpy - by deanhystad - Apr-03-2024, 02:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Numpy] How to store different data type in one numpy array? water 7 818 Mar-26-2024, 02:18 PM
Last Post: snippsat
  Numpy returns "TypeError: unsupported operand type(s) for *: 'numpy.ufunc' and 'int'" kalle 2 2,709 Jul-19-2022, 06:31 AM
Last Post: paul18fr
  "erlarge" a numpy-matrix to numpy-array PhysChem 2 3,050 Apr-09-2019, 04:54 PM
Last Post: PhysChem

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020