我想了解为什么会出现此错误:TypeError: unhashable type: 'set',当我运行此代码时
import matplotlib.pyplot as plt
import networkx as nx
def my_function(file):
file = file.explode('Two')
G = nx.DiGraph()
nx.add_path(G, file['One'])
nx.add_path(G, file['Two'])
nx.draw_networkx(G)
plt.show()
return
使用此数据集:
One Two
wine {wine, beer, wine, water}
table {table, oven, chair, kitchen}
car {cars, bike, bike}
我没有使用set(nor frozenset),但我认为问题可能出在括号中。
紫衣仙女
相关分类