import pandas as pd
from pycaret.datasets import get_data
import dtale
/home/cylim/anaconda3/envs/experiment_lab/lib/python3.8/site-packages/dtale/dash_application/charts.py:13: UserWarning: The dash_core_components package is deprecated. Please replace `import dash_core_components as dcc` with `from dash import dcc` import dash_core_components as dcc /home/cylim/anaconda3/envs/experiment_lab/lib/python3.8/site-packages/dtale/dash_application/charts.py:14: UserWarning: The dash_html_components package is deprecated. Please replace `import dash_html_components as html` with `from dash import html` import dash_html_components as html
# Record version of key libraries
from importlib.metadata import version
print('dtale==%s' % version('dtale'))
dtale==1.56.0
# Select a pre-packaged data for testing
df = get_data('diabetes', verbose=True)
Number of times pregnant | Plasma glucose concentration a 2 hours in an oral glucose tolerance test | Diastolic blood pressure (mm Hg) | Triceps skin fold thickness (mm) | 2-Hour serum insulin (mu U/ml) | Body mass index (weight in kg/(height in m)^2) | Diabetes pedigree function | Age (years) | Class variable | |
---|---|---|---|---|---|---|---|---|---|
0 | 6 | 148 | 72 | 35 | 0 | 33.6 | 0.627 | 50 | 1 |
1 | 1 | 85 | 66 | 29 | 0 | 26.6 | 0.351 | 31 | 0 |
2 | 8 | 183 | 64 | 0 | 0 | 23.3 | 0.672 | 32 | 1 |
3 | 1 | 89 | 66 | 23 | 94 | 28.1 | 0.167 | 21 | 0 |
4 | 0 | 137 | 40 | 35 | 168 | 43.1 | 2.288 | 33 | 1 |
# View data via dtale interface
# NOTE - dtale data display currently does not work in notebook. blank space is shown instead.
# NOTE - running this will start a new data instance (in a subprocess) in the background
# NOTE - depending on computer setup, manually change address to localhost (instead of machine name) to view the interface in browser
# NOTE - dtale is a tool rather than automation, in terms of typical EDA. manually use the tool to perform EDA
# NOTE - for a list of functionalities supported, check out the README on https://github.com/man-group/dtale
# d = dtale.show(df, notebook=True)
d = dtale.show(
df,
host='localhost', port='40000',
open_browser=True, ignore_duplicate=False
)
# # Manually open dtale interface using default system browser
# d.open_browser()
# # To alter data associated with dtale process
# d.data = df2
2021-09-12 16:55:16,321 - INFO - NumExpr defaulting to 6 threads.
# Show a list of all dtale instances
dtale.instances()
# # Shutting down dtale process
# d.kill()
To gain access to an instance object simply pass the value from 'ID' to dtale.get_instance(ID) ID Name URL 1 http://localhost:40000/dtale/main/1 http://localhost:40000/dtale/main/1 Executing shutdown due to inactivity...
2021-09-12 17:55:18,489 - INFO - Executing shutdown due to inactivity...
Executing shutdown...
2021-09-12 17:55:18,517 - INFO - Executing shutdown...