I am using python-3.x, and I am trying to convert a list of a numpy array "Binary's" to decimal numbers, as I know I need to convert these Binary's first to Strings then I can convert them to Decimal ex:
1.Binary = 101011111 >>> 2.String= '101011111' >>>>> 3.decimal= 351
binary= '101011111'
binary = int(binary, 2)
print (binary)
But is there any way to convert a list of Binary's straightaway to decimal I don't want to convert them to Strings?
1.Binary = 101011111 >>> 2.decimal= 351
My input is:
Type: int64
Size:(3, 8)
Value: array:([[1,0,0,1,1,0,0,0],
[1,1,1,1,1,0,0,0],
[1,0,0,1,1,1,0,1]])
the output: ([[152],
[248],
[157]])