Created
February 21, 2019 16:44
-
-
Save CermakM/1fcd03af3d2516cce63ed0f3bb4a45bd to your computer and use it in GitHub Desktop.
Example of Jupyter d3.js integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from thoth.lab.utils import str_join | |
from thoth.lab.viz import init_notebook_mode, plot | |
init_notebook_mode() | |
df = pd.DataFrame([ | |
{'name': "root",}, | |
{'name': "tensorflow", 'parent': "root", 'package_version': '1.4.0'}, | |
{'name': "tensorflow", 'parent': "root", 'package_version': '1.5.0'}, | |
{'name': "numpy", 'parent': "tensorflow", 'parent_version': '1.4.0', 'package_version': '1.0.0'}, | |
{'name': "numpy", 'parent': "tensorflow", 'parent_version': '1.4.0', 'package_version': '1.1.0'}, | |
{'name': "numpy", 'parent': "tensorflow", 'parent_version': '1.5.0', 'package_version': '1.2.0'}, | |
]) | |
df['source'] = str_join(df, ['parent', 'parent_version'], '==') | |
df['target'] = str_join(df, ['name', 'package_version'], '==') | |
plot(df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment