小编NK0*_*K09的帖子

在 Python 中绘制有向图?

我正在尝试为客户状态迁移制作有向图或桑基图(任何都可以)。数据如下所示,count 表示从当前状态迁移到下一个状态的用户数。

**current_state         next_state          count**
New Profile              Initiated           37715
Profile Initiated          End               36411
JobRecommended             End                6202
New                        End                6171
ProfileCreated             JobRecommended     5799
Profile Initiated          ProfileCreated     4360
New                        NotOpted           3751
NotOpted                   Profile Initiated  2817
JobRecommended             InterestedInJob    2542
IntentDetected             ProfileCreated     2334
ProfileCreated             IntentDetected     1839
InterestedInJob            Applied            1671
JobRecommended             NotInterestedInJob 1477
NotInterestedInJob         ProfileCreated     1408
IntentDetected             End                1325
NotOpted                   End                1009
InterestedInJob            ProfileCreated     975
Applied                    IntentDetected     912
NotInterestedInJob         IntentDetected     720
Applied                    ProfileCreated     701
InterestedInJob            End                673
Run Code Online (Sandbox Code Playgroud)

我编写了一个构建 sankey 的代码,但该图不易阅读。寻找可读的有向图。这是我的代码:

    df = pd.read_csv('input.csv')

    x = …
Run Code Online (Sandbox Code Playgroud)

python directed-graph plotly

6
推荐指数
1
解决办法
1971
查看次数

标签 统计

directed-graph ×1

plotly ×1

python ×1