Visualisierung geändert auf Src_Department > Dest_Department
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import pandas as pd
|
||||
import plotly.graph_objects as go
|
||||
import plotly.pigraph_objects as go
|
||||
import sys
|
||||
import os
|
||||
|
||||
@@ -36,19 +36,16 @@ except Exception as e:
|
||||
# --- DATEN AGGREGIEREN ---
|
||||
# Wir zählen die Kommunikationspfade zwischen den Abteilungen
|
||||
|
||||
''' df_agg = df.groupby(['source_department', 'destination_department']).size().reset_index(name='weight') '''
|
||||
df_agg = df.groupby(['source_department', 'destination_displayname']).size().reset_index(name='weight')
|
||||
df_agg = df.groupby(['source_department', 'destination_department']).size().reset_index(name='weight')
|
||||
|
||||
# Liste aller Departments für die Knoten-Beschriftung
|
||||
''' all_nodes = list(pd.concat([df_agg['source_department'], df_agg['destination_department']]).unique()) '''
|
||||
all_nodes = list(pd.concat([df_agg['source_department'], df_agg['destination_displayname']]).unique())
|
||||
all_nodes = list(pd.concat([df_agg['source_department'], df_agg['destination_department']]).unique())
|
||||
|
||||
node_map = {name: i for i, name in enumerate(all_nodes)}
|
||||
|
||||
# Mapping auf Indizes
|
||||
source_indices = df_agg['source_department'].map(node_map)
|
||||
target_indices = df_agg['destination_displayname'].map(node_map)
|
||||
''' target_indices = df_agg['destination_department'].map(node_map) '''
|
||||
target_indices = df_agg['destination_department'].map(node_map)
|
||||
|
||||
weights = df_agg['weight']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user