def handlePCA(self, event=None):
if self.data is None:
tkMessageBox.showerror("No File Open", "Please open a file first!")
return
d = PCADialog(self.root, self.data.get_headers())
if d.result is None:
return
if d.result[2] in self.pca_data.keys():
tkMessageBox.showwarning("Replacing Saved Analysis",
"Please delete old analysis before creating another with the same name.")
return
if d.result[0] == 1:
self.pca_data[d.result[2]] = analysis.pca(self.data, d.result[1])
self.pca_data[d.result[2]].write_to_file(d.result[2], self.pca_data[d.result[2]].get_headers())
print "Normalizing: True"
else:
self.pca_data[d.result[2]] = analysis.pca(self.data, d.result[1], False)
self.pca_data[d.result[2]].write_to_file(d.result[2], self.pca_data[d.result[2]].get_headers())
print "Normalizing: False"
if not self.pca_controls_built:
self.buildPCAControls()
self.pca_lbox.insert(tk.END, d.result[2])
评论列表
文章目录