python - 如何从以下 csv 制作图网络
问题描述
我从抓取 scopus 中获得了以下 csv。我想建立一个来自同一个国家的作者网络——就像每次两位作者来自同一个国家时,我们在他们之间添加一个优势。
这是我正在使用的完整 csv 的链接。
https://drive.google.com/file/d/1B8yaMqFu9yHQudrWI-8-mCpo6pt1T2oW/view?usp=sharing
另外,有谁知道如何查找文章 ['eid] 的引文数据并解析数据,例如:
下表:
author cited-by author paper auth-university auth-country
这个想法是建立一个由作者和共同作者组成的网络,如果每个作者在被引作者列中都有相应的值,则添加一条边。
解决方案
您可以在国家/地区使用内部连接来获得优势:
import pandas as pd
data = pd.read('/path/to/file.csv')
combinations = pd.merge(data, data, how='inner', on='country')
edges = combinations['author_x', 'author_y']
推荐阅读
- php - Foreach 复制复选框输入表单
- php - slim/twig-view 不适用于附加路由中间件
- angularjs - 动态添加联系号码的角度反应
- marklogic - 在marklogic中将数据插入森林
- jquery - 使用jquery验证视图中的空值
- git - 当 Jenkins 从 git origin 获取时,它给出错误“无法锁定 ref”
- javascript - 如何向原型添加属性(javascript)
- c# - Gridview 仅显示 MySQL 数据库中的 1 行 - ASP.net C#
- node.js - 类型错误:getUserInfo 不是函数
- html - 如何在 HTML/CSS 中为视频添加边框半径