summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/README.md b/README.md
index 0ef3ef4..b98470c 100644
--- a/README.md
+++ b/README.md
@@ -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.