<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

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}