def mtx_transpose(dictmtx):
    """Returns transposes of a matrix in COO format (expressed as a dict).

    :param dictmtx: dictionary containing COO matrix
    :rtype: dictionary of (row, col): val matrix entries
    """
    return {(j, i): dictmtx[(i, j)] for i, j in dictmtx.keys()}