-2

I am trying to learn how to use the holoview package.

I found these two notebooks that seems useful: https://anaconda.org/jbednar/bednar_index_2017/notebook & http://holoviews.org/getting_started/Tabular_Datasets.html.

However, I can not create a hv.dataset as i get the error:

typeError: __init__() takes 2 positional arguments but 4 were given.

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

vdims = [('complaint_frac', 'frac')]
ds = hv.Dataset(df_plot3, ['ComplaintType', 'hour'], vdims)
measles_by_state = ds.to(hv.Curve, 'hour', 'complaint_frac')
measles_by_state * hv.VLine(1963)

Here is the pandas' data frame:

enter image description here

Any assistance would be great!

Edit:

As requested, the error tractback:

 TypeError                                 Traceback (most recent call last)
<ipython-input-59-3491a16b7264> in <module>()
      1 vdims = [('complaint_frac', 'frac')]
----> 2 ds = hv.Dataset(df_plot3, ['hour', 'ComplaintType'], vdims)
      3 measles_by_state = ds.to(hv.Curve, 'hour', 'complaint_frac')
      4 measles_by_state * hv.VLine(1963)
      5 

TypeError: __init__() takes 2 positional arguments but 4 were given
Aaron C
  • 301
  • 1
  • 8

1 Answers1

1

Probably because you pass the second and third parameter as positional arguments. Try passing them as keyword arguments.

ds = hv.Dataset(df_plot3, kdims=['ComplaintType', 'hour'], vdims=vdims)
Thinh Pham
  • 402
  • 3
  • 6