rename variables in graph
This commit is contained in:
@@ -49,7 +49,7 @@ master.spark.sparkContext.setCheckpointDir('./checkpoints') # spark is really a
|
||||
|
||||
tx_df = master.get_tx_dataframe()
|
||||
|
||||
transaction_as_vertices = tx_df \
|
||||
addresses_as_vertices = tx_df \
|
||||
.select('address') \
|
||||
.withColumnRenamed('address', 'id') \
|
||||
.distinct()
|
||||
@@ -65,7 +65,7 @@ transactions_as_edges = tx_df \
|
||||
.flatMap(explode_row) \
|
||||
.toDF(['src', 'dst'])
|
||||
|
||||
g = GraphFrame(transaction_as_vertices, transactions_as_edges)
|
||||
g = GraphFrame(addresses_as_vertices, transactions_as_edges)
|
||||
components = g.connectedComponents(algorithm='graphframes')
|
||||
|
||||
master.write_connected_components_as_clusters(components)
|
||||
|
||||
Reference in New Issue
Block a user