Skip to content

Commit

Permalink
Added handling of nans for bivariate element
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Nov 9, 2017
1 parent 8ea96dd commit 98221fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion holoviews/operation/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ def _process(self, element, key=None):
elif ymin == ymax:
ymin, ymax = ymin-0.5, ymax+0.5

if len(element) > 1:
data = data[:, np.isfinite(data).min(axis=0)]
if len(data) > 1:
kde = stats.gaussian_kde(data)
if self.p.bandwidth:
kde.set_bandwidth(self.p.bandwidth)
Expand All @@ -200,6 +201,7 @@ def _process(self, element, key=None):
ys = _kde_support((ymin, ymax), bw, self.p.n_samples, self.p.cut, ydim.range)
xx, yy = cartesian_product([xs, ys], False)
positions = np.vstack([xx.ravel(), yy.ravel()])
print(positions.shape)
f = np.reshape(kde(positions).T, xx.shape)
elif self.p.contours:
eltype = Polygons if self.p.filled else Contours
Expand Down

0 comments on commit 98221fe

Please sign in to comment.