import csv
from ast import literal_eval
with open("file.csv", "r") as f:
reader = csv.DictReader(f, delimiter=",") # <-- adjust the sep if needed
rows = list(reader)
points = [literal_eval(row["xy"]) for row in rows]
edges = [(literal_eval(row["v1v2"]) + (int(row["w"]),)) for row in rows]
1条答案
按热度按时间rggaifut1#
您可以使用以下命令从
.csv
开始输入:然后你可以使用/readapt @* Sparky 05 * 的answer。
输出: