Skip to content

Commit

Permalink
iloc bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ftheberge committed Jul 25, 2024
1 parent 69821dd commit 98dc91b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hypernetx/algorithms/hypergraph_modularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def modularity(HG, A, wdc=linear):
_df = pd.DataFrame(zip(_keys, _vals), columns=["key", "val"])
_df = _df.groupby(by="key").sum()
EC = sum(
[wdc(k[1], k[0]) * v[0] for (k, v) in _df.iterrows() if k[0] > k[1] / 2]
[wdc(k[1], k[0]) * v.iloc[0] for (k, v) in _df.iterrows() if k[0] > k[1] / 2]
)

## Degree Tax
Expand Down Expand Up @@ -402,7 +402,7 @@ def _last_step_weighted(H, A, wdc, delta=0.01, verbose=False):
_df = _df.groupby(by="key").sum()
ec = sum(
[
wdc(k[1], k[0]) * val[0]
wdc(k[1], k[0]) * val.iloc[0]
for (k, val) in _df.iterrows()
if k[0] > k[1] / 2
]
Expand Down Expand Up @@ -430,7 +430,7 @@ def _last_step_weighted(H, A, wdc, delta=0.01, verbose=False):
_df = _df.groupby(by="key").sum()
ecp = sum(
[
wdc(k[1], k[0]) * val[0]
wdc(k[1], k[0]) * val.iloc[0]
for (k, val) in _df.iterrows()
if k[0] > k[1] / 2
]
Expand Down

0 comments on commit 98dc91b

Please sign in to comment.