So I'm attempting to build a chord diagram using holoviews and bokeh and running into some issues. I found a few posts that were somewhat related, but didn't help me much. Essentially I need help with tackling the error at the end so that I can see how the new chord diagram with the labels and coloring (chord.opts).
Essentially I have a list of names (and their respective business units) and the people they have been paired with in a program. I want to visualize the connections each person has had with a chord diagram.
FULL DISCLOSURE: The code below may be completely wrong...but this is what I came up with after looking at the example.
import holoviews as hv
from holoviews import opts, dim
import pandas as pd
import numpy as np
from bokeh.plotting import figure, output_file, show
from bokeh.io import output_notebook
output_notebook()
hv.extension('bokeh')
hv.output(size=200)
book1 = "../desktop/book3.xls"
pairs = pd.read_excel (book1)
pair_counts = pairs.groupby(['id1', 'id2']).name2.count().reset_index()
pair_counts looks like this: pair_counts
test = hv.Chord(pair_counts)
hv.save(test,'test.png')
This outputs the following picture. test.png
nodes = hv.Dataset(pairs, 'id1', 'bu1')
nodes.data.head()
test2 = hv.Chord((test, nodes)).select(value=(5, None))
After this line I get the following error:
DataError: None of the available storage backends were able to support the supplied data format.
continuing...
test2.opts(
opts.Chord(cmap='Category20', edge_cmap='Category20', edge_color=dim('bu2').str(),
labels='bu1', node_color=dim('bu1').str()))
hv.save(test2,'test2.png')
Here is what the excel data looks like: excel data
And here are the dtypes for the excel data in the df 'pairs':
pairs.dtypes
id1 int64
name1 object
dept1 object
bu1 object
id2 int64
name2 object
dept2 object
bu2 object
dtype: object