It needs to be base 64 encoded into a string.
from base64 import b64encode
data = {'B': b64encode(binary_data)}
There is a library that can do this for you: PynamoDB. The code which handles serialization to and from binary for Python 2 and 3 can be found here.
Disclaimer: I am the author of PynamoDB.