docs: def encode_numpy(array):
      '''Encode a numpy array as a base64 encoded string, to be JSON serialized. 
  
      :return: a dictionary containing the fields:
                  - *data*: the base64 string
                  - *type*: the array type
                  - *shape*: the array shape
  
      '''
      return {'data' : base64.b64encode(array.data).decode('utf8'),
              'type' : array.dtype.name,
              'shape': array.shape}