(y, labels={})
return y
Take in a numpy array and a dictionary of labels.
    Maps the items in the array to the labels.
Take in a numpy array and a dictionary of labels.
    Maps the items in the array to the labels.
Take in a numpy array and a dictionary of labels . Maps the items in the array to the labels .
def decode(y, labels={}):
    """
    Take in a numpy array and a dictionary of labels.
    Maps the items in the array to the labels.
    """

    # Setup a decoding function based on the dictionary of labels
    decode = lambda x, d={}: round(x) if round(x) not in d else d[round(x)]
    # Store the shape of the array
    shape = y.shape
    # Flatten the array and perform the decoding 
    y = np.array([decode(atof(x), labels) for x in y.ravel()])
    # Reshape the array back to it's original form
    y = np.reshape(y, shape)

    return y
def decode ( y , labels = { } ) : # Setup a decoding function based on the dictionary of labels decode = lambda x , d = { } : round ( x ) if round ( x ) not in d else d [ round ( x ) ] # Store the shape of the array shape = y . shape # Flatten the array and perform the decoding  y = np . array ( [ decode ( atof ( x ) , labels ) for x in y . ravel ( ) ] ) # Reshape the array back to it's original form y = np . reshape ( y , shape ) return y