diff options
-rw-r--r-- | README.md | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -123,6 +123,10 @@ the filtration, we can either use `save_edge_list` or import numpy.ma as ma weights = np.random.uniform(0, 1, (100, 100)) + weights = (weights + weights.T)/2.0 # Symmetrize matrix (DIPHA doesn't specify + # which part of the weight matrix it actually + # uses, so be safe and symmetrize). + np.fill_diagonal(weights, 0) masked = ma.masked_greater(weights, 0.5) # All weights above 0.5 are # masked out and will not be # present in the graph, @@ -150,6 +154,10 @@ environment variables. import matplotlib.pyplot as plt weights = np.random.uniform(0, 1, (100, 100)) + weights = (weights + weights.T)/2.0 # Symmetrize matrix (DIPHA doesn't specify + # which part of the weight matrix it actually + # uses, so be safe and symmetrize). + np.fill_diagonal(weights, 0) dipharunner = dipha.DiphaRunner(2) # Compute up to 2-simplices. dipharunner.weight_matrix(weights) # See also dipharunner.masked_weight_matrix, # and dipharunner.edge_list. |