I am trying to covert and array filed with decimals from 0 to 63 , x=[0 1 2 ... 63] into an array with the equal binaries, but I get the following error: "invalid literal for int() with base 10: '0b0'". My code is the following (in Python) :
g=np.arange(0,64,1)
for x in range(0,64,1):
g[x]=bin(g[x])
I am new to python, so if anyone can find my mistake (logic or syntax) I would appreciate any help. extra: Is there any way to make the binaries 6 bits that get put in the array?