title: Plotly not handling NA's well for Bar charts. Where shall I address that?
body: <p>I want to create a bar-chart with the plotly backend. I use the <code>aggregate</code>-function to count the number of items in each category. Let me show an example.
  First I create some test-data:</p>
  <pre><code>import holoviews as hv
  hv.extension('plotly')
  import numpy as np
  import pandas as pd
  samples = 100
  
  pets = ['Cat', 'Dog', 'Hamster', 'Rabbit']
  genders = ['Female', 'Male']
  
  pets_sample = np.random.choice(pets, samples)
  gender_sample = np.random.choice(genders, samples)
  df=pd.DataFrame(data={'pet':pets_sample,'gender':gender_sample,})
  df['pet']=pd.Categorical(df['pet'])
  df['gender']=pd.Categorical(df['gender'])
  # Delete male hamsters so we have an empty category-combination
  df=df[~((df['pet']=='Hamster') &amp; (df['gender']=='Male'))]
  df['name']=['Animal #'+str(i) for i in range(len(df))]
  df=df[['name','pet','gender']]
  df
  </code></pre>
  <p><a href="https://i.stack.imgur.com/fVOUk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fVOUk.png" alt="dataframe" /></a></p>
  <p>When I try to plot this, using</p>
  <pre><code>bars = hv.Bars(df, kdims=['pet', 'gender'],vdims='name').aggregate(function=np.count_nonzero)
  
  bars.opts(width=1000,multi_level=False)
  </code></pre>
  <p>I get the following error: <code>ValueError: Out of range float values are not JSON compliant</code>.</p>
  <p>The reason for that is (I think) that there is one NA in the aggregated table:</p>
  <pre><code>hv.Table(df, kdims=['pet', 'gender'],vdims='name').aggregate(function=np.count_nonzero)
  </code></pre>
  <p>returns</p>
  <p><a href="https://i.stack.imgur.com/XcbX5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XcbX5.png" alt="Aggregated table" /></a></p>
  <p>You can solve this problem by adding a new column to the dataframe, just consisting of ones and use <code>np.sum</code> instead of <code>np.count_nonzero</code> and then everything works:</p>
  <pre><code>df['ones']=1
  bars=hv.Bars(df, kdims=['pet', 'gender'],vdims=[('ones','count')]).aggregate(function=np.sum)
  bars.opts(width=1000,multi_level=False)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/SmUQG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SmUQG.png" alt="bar-chart" /></a></p>
  <p>I think NA's should default to zero when making Bar-charts. My original approach works fine if I use <code>bokeh</code> as backend.
  I would like to know where would be a good place to address this issue. The github of holoviews of plotly?</p>