The problem is that numpy's float32
is stored as little endian and bitstrings default implementation is bigendian. The solution is to specify little endian as the data type.
my_file = open('float_test.bin', 'rb')
raw_data = ConstBitStream(my_file)
float_num_ = raw_data.readlist('floatle:32')
print float_num
print float_num_
Output:
3.4353
3.43530011177
Reference on bitstring datatypes, here.