Commits

Amela Rakanovic committed 35278c5

Refactored OWIndContinuousQt.

Comments (0)

Files changed (1)

Orange/OrangeWidgets/Statistics/OWIndContinuousQt.py

                 self.pearson_array = []
                 self.pearson_array = fun_statistics(self.ddataset, self.attributes, stats.pearsonr)[0]
                 
-                self.correlation_np = np.array(self.pearson_array)
-                self.set_table()
-                self.to_graph()
+                self.set_table_graph(self.pearson_array)
             
             else:
-                self.correlation_np = np.array(self.pearson_array)
-                self.set_table()
-                self.to_graph()
+                self.set_table_graph(self.pearson_array)
             
         elif self.test_select == 1:
             if self.spearman_dirty == 0:
                 self.spearman_array = []
                 self.spearman_array = fun_statistics(self.ddataset, self.attributes, stats.spearmanr)[0]
                     
-                self.correlation_np = np.array(self.spearman_array)
-                self.set_table()
-                self.to_graph()
+                self.set_table_graph(sself.spearman_array)
             
             else:
-                self.correlation_np = np.array(self.spearman_array)
-                self.set_table()
-                self.to_graph()
+                self.set_table_graph(sself.spearman_array)
         else:
             print 'Error'
+
+    def set_table_graph(self, test_array):
+        self.correlation_np = np.array(test_array)
+        self.set_table()
+        self.to_graph()
                  
     def data(self, dataset):