擅长:python、mysql、java
<p>有意思。。我看不出结果:</p>
<pre><code>>>> from graphframes.examples import Graphs
>>> import graphframes
>>> g = Graphs(sqlContext).friends() # Get example graph
>>> # Select subgraph of users older than 30
... v2 = g.vertices.filter("age > 30")
>>> g2 = graphframes.GraphFrame(v2, g.edges)
>>> print(g.vertices.count(), g.edges.count())
(6, 7)
>>> print(g2.vertices.count(), g2.edges.count())
(4, 7)
</code></pre>
<p>到现在为止,GraphFrames不检查图是否有效-也就是说,在图形构建时,所有的边都连接到顶点等等。但是在过滤器之后顶点的数量似乎是正确的?在</p>