I want to convert this hexadecimal array :
[7,3,2,0,1,9,0,4]
into this one
[0,1,1,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,1,0,0]
where you can recognize the first 4 integers is egal to 7 in binary format (0111), and so on.
I tried to use format(x, '04b') but the result is in string format :
['0111','0011','0010','0000','0001','1001','0000','0100']
Consequently I can't use the result as binary array. How to do that ?
list(map(int,list(''.join(a))))whereais your current result but it seems a bit ugly.list(map(int,''.join(a)))[7,3,2,0,1,9,0,4]a hexadecimal array? It looks like it only contains decimal integers.