Here is my code:
import numpy as np
import pandas as pd
import networkx as nx
df = pd.read_excel(r"/path/to/file.xlsx", sheet_name="Sheet4")
df.edge=nx.from_pandas_edgelist(df,source='Abrev')
print(list(enumerate_all_cliques(nx.Graph(df.edge))))
if gives me a key error of KeyError: 'Abrev'
for this code but I also tried changing 'Abrev'
to 0
and deleting the source='Abrev'
all together and just get a slight different error for each; 'KeyError: 0
'KeyError: 'source'
Sample contents of excel file;
+---+---+---+---+---+
| | A | B | C | D |
+---+---+---+---+---+
| A | 0 | 1 | 1 | 0 |
+---+---+---+---+---+
| B | 1 | 0 | 0 | 1 |
+---+---+---+---+---+
| C | 1 | 0 | 0 | 1 |
+---+---+---+---+---+
| D | 0 | 1 | 1 | 0 |
+---+---+---+---+---+