Skip to Content
数据分析之图算法: 基于Spark和Neo4j
book

数据分析之图算法: 基于Spark和Neo4j

by Mark Needham, Amy E. Hodler
September 2020
Intermediate to advanced
213 pages
5h 25m
Chinese
Posts & Telecom Press
Content preview from 数据分析之图算法: 基于Spark和Neo4j
96
6
6-2:示例图模型
下面基于示例
CSV
文件在
Spark
Neo4j
中创建图。
6.1.1
 将数据导入
Spark
首先从
Spark
GraphFrames
包中导入所需的包:
from graphframes import
*
下面的函数从示例
CSV
文件中创建一个
GraphFrame
对象:
def
create_software_graph():
nodes = spark.read.csv("data/sw-nodes.csv", header=True)
relationships = spark.read.csv("data/sw-relationships.csv", header=True)
return
GraphFrame(nodes, relationships)
然后调用该函数。
g = create_software_graph()
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

大数据项目管理:从规划到实现

大数据项目管理:从规划到实现

Ted Malaska, Jonathan Seidman
Presto实战

Presto实战

Matt Fuller, Manfred Moser, Martin Traverso
精實企業|高績效組織如何達成創新規模化

精實企業|高績效組織如何達成創新規模化

Jez Humble, Joanne Molesky, Barry O'Reilly

Publisher Resources

ISBN: 9787115546678