# Buggy code
def _get_stat(self, dim):
    stat_kwargs = {}

    if self.source is not None:
        stat_kwargs["source"] = self.source

        if len(self.dimensions.keys()) > 0:
            stat_kwargs["column"] = self.dimensions[dim]
        elif self.column is not None:
            stat_kwargs["column"] = self.column
        else:
            stat_kwargs["column"] = "values"
    elif self.values is not None:
        stat_kwargs["values"] = self.values
    else:
        raise ValueError("Could not identify bin stat for %s" % dim)

    # if list(self.dimensions.keys()):
    #    stat_kwargs['bin_count'] = self.bin_count[idx]

    return BinStats(**stat_kwargs)


# Traceback (OverflowError)
Traceback (most recent call last):
File "test.py", line 22, in <module>
hist = Histogram(df, values='values',  legend=True,
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/builder/histogram_builder.py", line 53, in Histogram
return create_and_build(HistogramBuilder, data, **kw)
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/_builder.py", line 64, in create_and_build
chart.add_builder(builder)
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/_chart.py", line 134, in add_builder
builder.create(self)
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/_builder.py", line 303, in create
chart.add_renderers(self, renderers)
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/_chart.py", line 129, in add_renderers
self.renderers += renderers
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/builder/bar_builder.py", line 228, in _yield_renderers
**group_kwargs)
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/glyphs.py", line 469, in __init__
super(HistogramGlyph, self).__init__(**kwargs)
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/_models.py", line 61, in __init__
self.setup()
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/_models.py", line 64, in setup
self.renderers = [renderer for renderer in self.build_renderers()]
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/glyphs.py", line 478, in build_renderers
self.bins = Bins(values=self.values, bin_count=self.bin_count)
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/stats.py", line 164, in __init__
super(Bins, self).__init__(**properties)
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/stats.py", line 23, in __init__
self._refresh()
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/stats.py", line 29, in _refresh
self.calculate()
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bokeh/charts/stats.py", line 174, in calculate
binned, bin_edges = pd.cut(self.get_data(), self.bin_count, retbins=True, precision=0)
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas/tools/tile.py", line 100, in cut
bins = np.linspace(mn, mx, bins + 1, endpoint=True)
File "/Users/<username>/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/core/function_base.py", line 84, in linspace
num = int(num)
OverflowError: cannot convert float infinity to integer

# Fixed code
def _get_stat(self, dim):
    stat_kwargs = {}

    if self.source is not None:
        stat_kwargs["source"] = self.source

        if len(self.dimensions.keys()) > 0:
            stat_kwargs["column"] = self.dimensions[dim]
        elif self.column is not None:
            stat_kwargs["column"] = self.column
        else:
            stat_kwargs["column"] = "values"
    elif self.values is not None:
        stat_kwargs["values"] = self.values
    else:
        raise ValueError("Could not identify bin stat for %s" % dim)

    # ToDo: handle multiple bin count inputs for each dimension
    if len(self.bin_count) == 1:
        stat_kwargs["bin_count"] = self.bin_count[0]

    return BinStats(**stat_kwargs)