def _transpose_named_matrix(mat):
 (mat['nrow'], mat['ncol']) = (mat['ncol'], mat['nrow'])
 (mat['row_names'], mat['col_names']) = (mat['col_names'], mat['row_names'])
 mat['data'] = mat['data'].T

def _transpose_named_matrix ( mat ) : ( mat [ 'nrow' ] , mat [ 'ncol' ] ) = ( mat [ 'ncol' ] , mat [ 'nrow' ] ) ( mat [ 'row_names' ] , mat [ 'col_names' ] ) = ( mat [ 'col_names' ] , mat [ 'row_names' ] ) mat [ 'data' ] = mat [ 'data' ] . T
transpose mat inplace .