How can I : Read Text File with binary number using pandas in python and convert or keep (00001101)into binary as my function need as '0b00001101'?

Viewed 75
from sgposit.pcposit import PCPosit
x = 0b00000011
y = 0b00000011
a = PCPosit(x, mode='bits', nbits=8, es=2)

`Simple code, where I would like to get the value of "a" as 'Binary'. I have been trying to to do using pandas as CSV file. Also was trying to do as text file.

But The difficulties are the value of "x" & "y". For These, I have text_file.text of 256 data. Which I have to read into python and take those values as input for "a".

Here, the main question is how could I read a text_file.text file and have to keep it in this (0b00110001). It should not be an 'str' or '110001'- without initial zero or '0b00110001' or '0b110001'.

enter image description here

0 Answers
Related