Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

df.hvplot() not working in colab #153

Closed
mckeown12 opened this issue Jan 25, 2019 · 6 comments
Closed

df.hvplot() not working in colab #153

mckeown12 opened this issue Jan 25, 2019 · 6 comments
Labels

Comments

@mckeown12
Copy link

The example from the usage page returns no output in a python3 colab notebook:

!pip install hvplot holoviews
import pandas as pd, numpy as np
idx = pd.date_range('1/1/2000', periods=1000)
df  = pd.DataFrame(np.random.randn(1000, 4), index=idx, columns=list('ABCD')).cumsum()

import hvplot.pandas
df.hvplot()

With a python2 runtime, the second cell hangs.

@arabidopsis
Copy link

I got this too.... (with python3)

I think hvplot is not using the index as the x variable... doing

df=df.reset_index()
df.hvplot(x='index')

works. Is this a bug?

@ahuang11
Copy link
Collaborator

This worked for me; I think you need to add two steps in Colab: hv.extension('bokeh') and hvplot.show()

import holoviews as hv
hv.extension('bokeh')

import hvplot.pandas
import pandas as pd, numpy as np

idx = pd.date_range('1/1/2000', periods=1000)
df  = pd.DataFrame(np.random.randn(1000, 4), index=idx, columns=list('ABCD')).cumsum()

hvplot.show(df.hvplot())

image

@loopinf
Copy link

loopinf commented Apr 30, 2019

hello @ahuang11
I tried the same code but there is an ImportError

Do you have any idea?

WARNING:param.notebook_extension: Holoviews bokeh extension could not be imported, it raised the following exception: ImportError('cannot import name 'GridBox'')
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-5ffd9cebd254> in <module>()
      1 import holoviews as hv
----> 2 hv.extension('bokeh')
      3 
      4 import hvplot.pandas
      5 import pandas as pd, numpy as np

2 frames
/usr/local/lib/python3.6/dist-packages/holoviews/util/__init__.py in __call__(self, *args, **params)
    698 
    699         if selected_backend is None:
--> 700             raise ImportError('None of the backends could be imported')
    701         Store.set_current_backend(selected_backend)
    702 

ImportError: None of the backends could be imported

@ahuang11
Copy link
Collaborator

@loopinf !pip install -U bokeh should fix it. Bokeh is probably outdated on Colab.

@jbednar
Copy link
Member

jbednar commented May 1, 2019

Right; you need bokeh 1.1.0 or later.

@philippjfr
Copy link
Member

So I'm going to close since this is a Panel/HoloViews issue and there's already this issue: holoviz/holoviews#3551

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants