'dtale show in jupyter notebook
I am exploring this new Python
package named dtale
. It is very convenient for pandas
data frames visualization.
https://pypi.org/project/dtale/
It worked once after 2 hours of loading.
Here is a reproduction of the code, where I reduce the dataset. It still takes hours to load on Jupyter Notebook.
import pandas as pd
import dtale
table = pd.DataFrame([[1, 2], [3, 4]], columns = ['a','b'])
d = dtale.show(table)
d
Comments from @cup and @AMC suggested to use it outside Jupyter notebook which I did using python console. It worked fine.
Any ideas on what is taking so long between Jupyter Notebook and Dtale?
Edit: It is not realy taking so long. The process block jupyter notebook while the data is accessible through the local link. http://LT0PAR01056937:40000/dtale/main/1 Jupyter notebook doesn't print the link and I can't kill it, I need to kill the entire kernel.
Thanks
Solution 1:[1]
I'm the main developer on D-Tale. So I wonder if the D-Tale is not showing up within your notebook because it is being hosted from HTTPS but the D-TAle process is hosted from HTTP (which will cause a CORS exception)
Also, if you want to kill a D-tale process within your notebook without having the restart the notebook's kernel you can do the following.
dtale.instances()
# using any of the data ids that are printed from the previous command
# it will also print the URL of each piece of data you've loaded into D-Tale
dtale.get_instance([data_id]).kill()
Also, if your notebook isn't being served under HTTPS you can also try forcing the host to 'localhost' by using the following:
dtale.show(df, host='localhost')
Then maybe it can be reached from localhost. You can also try just killing the cell you kicked your D-tale process off from before having to kill the entire kernel. Hope this helps.
Solution 2:[2]
If you want to use in Google COlab then this code will help.
import pandas as pd
import dtale
import dtale.app as dtale_app
dtale_app.USE_COLAB = True
dtale.show(pd.DataFrame([1,2,3]))
Solution 3:[3]
In google colab, adding import dtale.app as dtale_app
works fine.
import pandas as pd
import dtale
import dtale.app as dtale_app
table = pd.DataFrame([[1, 2], [3, 4]], columns = ['a','b'])
d = dtale.show(table)
d
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Andrew Schonfeld |
Solution 2 | ganesh raj |
Solution 3 | Suresh Gautam |