def subtract_2d(a, b):
    """
    Function subtracts two matrices and returns a matrix result.

    :param a:    (list) 2D matrix
    :param b:    (list) 2D matrix
    :return:     (list) 2D matrix containing the result of a-b
    """

    # zip a and inverted b then add the two matrix together
    zipped = list(zip(a, [[b[r][i] * -1 for i in range(len(b[r]))] for r in range(len(b))]))
    return [[sum(column) for column in zip(*group)] for group in zipped]