pandas 透视表 margins_name: 汇总行和列的名称。index: 分类列, 透视表的row索引。margins: 是否添加汇总行和列。columns: 透视表中的列索引。fill_value: 空值填充。values: 统计的列。aggfunc:统计函数。
infomap代码实现 from infomap import Infomapimport tqdmmin_sim = 0.5word_vecs = np.array(temp_v)#word_vecs = model.wv.vectorsword_vecs /= (word_vecs ** 2).sum(axis=1, keepdims=True) ** 0.5word2id = {j: i for i, j in enumerate(sub_n_words)}new_words = sub_n_words
notebook中使用已存在的conda环境 1、从要添加的虚拟环境中运行:python -m pip install ipykernel python -m ipykernel install --user --name '虚拟环境名' --display-name "notebook中显示的环境名"刷新notebook