其他
超好看的弦图,Python一行代码就能做
The following article is from 早起Python Author 刘早起早起
pip install chord
就可以。import pandas as pd
import itertools
from chord import Chord
data = list(itertools.chain.from_iterable((i, i[::-1]) for i in data.values))
matrix = pd.pivot_table(
pd.DataFrame(data), index=0, columns=1, aggfunc="size", fill_value=0
).values.tolist()
pd.DataFrame(matrix)