Matrix¶
Matrix class
Main Matrix Class.
-
class
diffupy.matrix.
Matrix
(mat=None, rows_labels=None, cols_labels=None, graph=None, quadratic=False, name='', init_value=None)[source]¶ Matrix class.
Initialize matrix.
- Parameters
mat – matrix initialization
rows_labels –
cols_labels – column labels
graph – graph
quadratic – quadratic
name – name
init_value – value to be initialized (int) or list of values from labels
-
validate_labels_and_update_ix_mappings
()[source]¶ Update function, called when the Matrix mutates, combining the two previous functionalities.
-
property
cols_labels
¶ Return a copy of Matrix Object.
-
property
rows_labels_ix_mapping
¶ Set row labels to ix.
-
property
cols_labels_ix_mapping
¶ Set column labels to ix.
-
property
rows_idx_scores_mapping
¶ Set mapping indexes to scores.
-
property
cols_idx_scores_mapping
¶ Set mapping indexes to scores.
-
match_mat
(reference_matrix, match_quadratic=None)[source]¶ Match method to set axis labels as reference matrix.
-
match_missing_rows
(reference_labels, missing_fill=0)[source]¶ Match method to set missing rows labels from reference labels with the missing_fill value.
-
match_delete_rows
(reference_labels)[source]¶ Match method to set missing rows labels from reference labels with the missing_fill value.
-
match_missing_cols
(reference_labels, missing_fill)[source]¶ Match method to set missing cols labels from reference labels with the missing_fill value.
-
to_df
(ordered=True)[source]¶ Export matrix as a data frame using the headers (row_labels, cols_labels) of the Matrix class.