We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68cbfdb commit dba28fcCopy full SHA for dba28fc
Orange/statistics/distribution.py
@@ -302,7 +302,7 @@ def mean(self):
302
303
def variance(self):
304
mean = self.mean()
305
- return sum(((x - mean) ** 2) * w for x, w in zip(self[0], self[1])) / sum(self[1])
+ return np.dot((self[0] - mean) ** 2, self[1]) / np.sum(self[1])
306
307
def standard_deviation(self):
308
return np.sqrt(self.variance())
0 commit comments