This commit is contained in:
msramalho
2022-09-27 13:58:00 +01:00
parent 99e844c6ce
commit f77d1d9d62

View File

@@ -43,11 +43,12 @@ class JSONEncoder:
self.state = []
def visitor(self, cluster_id, cluster):
print(cluster_id)
cluster_data = {"cluster_id": cluster_id, "points": []}
for record in cluster:
cluster_data["points"].append(record)
self.state.append(cluster_data)
self.state.append(cluster_data)
def get(self):
return json.dumps(self.state, cls=NpEncoder)