Permalink
Browse files

MAINT: gaussian_kde: better error message for 0/1-element input. Closes

  • Loading branch information...
1 parent 6ceda92 commit f01c0264a1798f200348a8c38ab56a097b69d707 @rgommers rgommers committed Dec 30, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 scipy/stats/kde.py
View
@@ -170,6 +170,9 @@ class gaussian_kde(object):
"""
def __init__(self, dataset, bw_method='scott'):
self.dataset = atleast_2d(dataset)
+ if not self.dataset.size > 1:
+ raise ValueError("`dataset` input should have multiple elements.")
+
self.d, self.n = self.dataset.shape
self.set_bandwidth(bw_method=bw_method)

0 comments on commit f01c026

Please sign in to comment.