Beispiel #1
0
    def updateDf(self, files: list):
        """
        checks if the dataframe can be updated by the newly imported filepaths
        calls the merge function if there is more than 1 file inside the filelist
        also udpates the detector frame (displaying dialect data)

        :param files: the whole filepath list
        """
        if len(files) > 1 or len(self.XMLList) > 0:
            canMerge = merger.prepareMerge(files, self.XMLList,
                                           self.DialectList)
            self.DialectList = merger.dialectList
            if canMerge:
                newDataFrame = merger.mergeFiles()
                importer.setDataFrame(newDataFrame)
                self.pt.updateModel(TableModel(newDataFrame))
                self.pt.redraw()
        elif len(files) > 0 and files[0].endswith(".csv"):
            if not any(files[0] in x for x in self.DialectList):
                self.dialect.guessDialectCSV(files[0])
                self.DialectList.append([files[0], self.dialect])
            else:
                x = [x for x in self.DialectList if files[0] in x][0]
                self.dialect = self.DialectList[self.DialectList.index(x)][1]
            importer.importCSV(files[0], self.dialect)
            updatedDataframe = importer.getDataFrame()
            self.pt.updateModel(TableModel(updatedDataframe))
            self.pt.redraw()
            self.updateDialect(self.dialect)
    def import_csv(self):
        # Get file to import
        input_file = tkFileDialog.askopenfilename()
        if not input_file.strip():
            tkMessageBox.showerror(title="Import Failed",
                                   message="Import failed as no file was selected.")
            return

        try:
            import_df = pd.read_csv(input_file)
        except ParserError:
            tkMessageBox.showerror(
                "The supplied file is not a valid CSV file, could not import.")

        if len(import_df) > 0:
            # Data was loaded.
            DataStore.data.reset_index(level=["id_product"], inplace=True)
            table_df = DataStore.data.append(import_df, ignore_index=False)
            table_df.set_index("id_product", inplace=True)

            DataStore.data = table_df
            self.data_table.updateModel(TableModel(table_df))
            self.data_table.redraw()

            tkMessageBox.showinfo(title="Import Successful",
                                  message="Import Completed Successfully!")
        else:
            tkMessageBox.showinfo(title="Import Failed",
                                  message="Input file did not have any CSV data so no data was added.")
Beispiel #3
0
    def __init__(self, parent=None):

        self.parent = parent

        Frame.__init__(self)

        self.main = self.master

        self.main.geometry('600x400+200+100')

        self.main.title('Table app')

        f = Frame(self.main)

        f.pack(fill=BOTH, expand=1)

        df = TableModel.getSampleData()

        self.table = pt = Table(f,
                                dataframe=df,
                                showtoolbar=True,
                                showstatusbar=True)

        pt.show()

        return
Beispiel #4
0
def smmm(u):
    #f.grid(row=15,column=0,sticky=W,ipadx=600,ipady=17)
 
    df = TableModel.getSampleData()
    pt = Table(leftFrame2,dataframe=u,showtoolbar=True, showstatusbar=True)
    pt.grid(row=15,column=0,sticky=W,ipadx=345,ipady=17)
    pt.show()
Beispiel #5
0
    def use_global_filter_local(self):

        pattern_df_lists = []

        for n in self.global_pattern_table.multiplerowlist:
            model_name = self.global_pattern_table.model.df.iloc[int(
                n)]['model']
            # logger.debug("model_name"+model_name)
            global_partition = self.global_pattern_table.model.df.iloc[int(
                n)]['partition']
            global_predictor = self.global_pattern_table.model.df.iloc[int(
                n)]['predictor']

            g_filter_l_query = " select array_to_string(fixed,',') as Partition,array_to_string(variable,',') as Predictor,"+\
            "array_to_string(fixed_value,',') as partition_values,agg,model,fixed,fixed_value,variable,"+\
            "theta,param,stats,dev_pos,dev_neg from "+self.assigned_local_table+\
            " where array_to_string(fixed,',')='"+global_partition+\
            "' and array_to_string(variable,',')='"+global_predictor+\
            "' and model = '"+model_name+"';"
            self.local_output_pattern_df = pd.read_sql(g_filter_l_query,
                                                       self.conn)
            # logger.debug(g_filter_l_query)

            local_shown = self.local_output_pattern_df[[
                'partition', 'partition_values', 'predictor', 'agg'
            ]]
        model = TableModel(dataframe=local_shown)
        self.local_pattern_table.updateModel(model)
        self.local_pattern_table.redraw()
Beispiel #6
0
def filter_data():
    global df
    global table

    # df.drop('column_name', axis=1, inplace=True)
    # df.drop(df.columns[[0, 1, 3]], axis=1)
    # df.drop([Column Name or list],inplace=True,axis=1)

    def f(x):
        suf = '(?={0})[^0-9]*'.format(re.escape(suf_filter.get()))
        bf = '(?={0})[^0-9]*'.format(re.escape(bf_filter.get()))
        hf = '(?={0})[^0-9]*'.format(re.escape(hf_filter.get()))
        chf = '(?={0})[^0-9]+'.format(re.escape(chf_filter.get()))

        b = ((active_characters[x[CHAR]].get() == 1)
             and (command_filter.get() == '' or x[CMD] == command_filter.get())
             and (hl_filter.get() == ''
                  or re.match(hl_filter.get(), x[HL]) is not None)
             and (suf_filter.get() == '' or re.match(suf, x[SUF]) is not None)
             and (bf_filter.get() == '' or re.search(bf, x[BF]) is not None)
             and (hf_filter.get() == '' or re.search(hf, x[HF]) is not None)
             and
             (chf_filter.get() == '' or re.search(chf, x[CHF]) is not None))

        return b

    tf = df[df[[CHAR, CMD, HL, SUF, BF, HF, CHF]].apply(f, axis=1)]

    temp = table.model.columnwidths
    table.model = TableModel(tf)
    table.model.columnwidths = temp
    table.redraw()
Beispiel #7
0
 def userData(self):
   self.__foodButton['state'] = NORMAL
   self.__userButton['state'] = DISABLED
   self.__selectedState = Sheets.USER
   self.df = self.table.model.df
   self.table.updateModel(TableModel(self.uf))
   self.table.redraw()
Beispiel #8
0
    def show_updated_output(self):

        filtered_result_df = self.use_local_filter_output()[1]
        self.query_result_df = filtered_result_df
        model = TableModel(dataframe=filtered_result_df)
        self.query_result_table.updateModel(model)
        self.query_result_table.redraw()
Beispiel #9
0
 def __init__(self, parent, controller):
     tk.Frame.__init__(self, parent)
     df = self.get_cryptocurrency()
     tb_m = TableModel(dataframe=df)
     table = Table(self, model=tb_m)
     table.show()
     table.redraw()
Beispiel #10
0
 def update_window(self, x0, y0, x, h):
     """
     Updates the graphs and the table accroding to the given data
     :param x0: initial position on x-axis
     :param y0: f(x0)
     :param x: final position on x-axis
     :param h: a grid step
     :return: None
     """
     x0_new, y0_new, x_new, h_new = float(x0.get()), float(y0.get()), float(
         x.get()), float(h.get())
     if x0_new < x_new and h_new > 0 and y0_new > 0 and (
             x_new - x0_new) / h_new <= 10000:
         plt.figure(1).gca().clear()
         plt.figure(2).gca().clear()
         plt.figure(3).gca().clear()
         df = self.plot.draw_functions(
             plt.figure(1).gca(), x0_new, y0_new, x_new, h_new)
         self.canvas1.draw()
         self.plot.draw_local_errors(
             plt.figure(2).gca(), x0_new, y0_new, x_new, h_new)
         self.canvas2.draw()
         self.plot.draw_approximation_errors(
             plt.figure(3).gca(), x0_new, y0_new, x_new)
         self.canvas3.draw()
         self.table.updateModel(TableModel(df))
         self.table.show()
Beispiel #11
0
    def reset_output(self):

        model = TableModel(dataframe=self.original_query_result_df)
        self.query_result_table.updateModel(model)
        self.query_result_table.redraw()

        self.query_result_df = self.original_query_result_df
Beispiel #12
0
    def run_query(self):

        self.user_query, self.query_group_str, self.agg_function, self.user_agg, self.agg_name, self.cur_table_name = self.query_temp.get_query(
        )
        # logger.debug(self.user_query)
        self.handle_view ="\nDROP VIEW IF EXISTS user_query;"+\
        "\nCREATE VIEW user_query as "+ self.user_query
        # logger.debug(self.handle_view)
        try:
            self.cur.execute(self.handle_view)
        except:
            tkinter.messagebox.showinfo("Info",
                                        "Invalid Query, Please Doublecheck!")

        self.original_query_result_df = pd.read_sql(self.user_query, self.conn)
        self.query_result_df = self.original_query_result_df

        self.plot_data_convert_dict, self.query_data_convert_dict = self.db_info.get_db_data_type(
            self.cur_table_name)
        self.plot_data_convert_dict[self.agg_name] = 'numeric'
        self.query_data_convert_dict[self.agg_name] = 'float'

        self.assigned_global_table = 'dev.{}_global'.format(
            self.cur_table_name)
        self.assigned_local_table = 'dev.{}_local'.format(self.cur_table_name)

        model = TableModel(dataframe=self.original_query_result_df)
        self.query_result_table.updateModel(model)
        self.query_result_table.redraw()
Beispiel #13
0
 def __init__(self, parent, controller):
     tk.Frame.__init__(self, parent)
     df = self.get_history()
     tb_m = TableModel(dataframe=df)
     table = Table(self, model=tb_m)
     table.show()
     #alter the DataFrame in some way, then update
     table.redraw()
Beispiel #14
0
    def get_data_for_symbol_list(self, parameter):
        self.parameter = parameter
        self.setting_view.update_view(parameter=parameter)
        df = self.get_correlation()
        tbm = TableModel(dataframe=df)

        self.table.model = tbm
        self.table.show()
        self.table.redraw()
Beispiel #15
0
 def __init__(self, parent=None):
     window = Toplevel(chirag)
     f = Frame(window)
     f.pack(fill=BOTH,expand=1)
     df = TableModel.getSampleData()
     table = pt = Table(f, dataframe=df,showtoolbar=True, showstatusbar=True)
     pt.importCSV(chirag.filename)
     pt.show()
     return
Beispiel #16
0
    def reset_output(self):

        model = TableModel(dataframe=self.original_query_result_df)
        self.query_result_table.updateModel(model)
        self.query_result_table.redraw()
        self.query_result_table.setRowColors(
            rows=self.high_outlier_row_numbers, clr='#ffffff', cols='all')
        self.query_result_table.setRowColors(rows=self.low_outlier_row_numbers,
                                             clr='#ffffff',
                                             cols='all')

        self.query_result_df = self.original_query_result_df
    def refresh_table_data(self):
        res = tkMessageBox.askyesno(title="Are you sure you want to refresh the DB.",
                                    message="Are you sure that you want to refresh the DB.\n"
                                    "This will undo any changes that you made before saving your data. This includes CSV file that you have imported")

        if res == tkMessageBox.NO:
            return

        data_df = get_db_data()

        DataStore.data = data_df
        self.data_table.updateModel(TableModel(data_df))
        self.data_table.redraw()
Beispiel #18
0
 def update(self):
     history = HistoryController.History()
     self.parameters = history.get_all_parameter_from_history()
     self.parameter_list = ParameterList(self, self.parameters)
     self.parameter_list.grid(row=1, column=1, sticky=(tk.N, tk.S, tk.E, tk.W))
     self.parameter_list.config(relief=tk.GROOVE, bd=2)
     df = self.get_correlation()
     tbm = TableModel(dataframe=df)
     if df.empty:
         return True
     self.table.model = tbm
     self.table.show()
     self.table.redraw()
Beispiel #19
0
    def refresh_table_data(self):
        res = tkMessageBox.askyesno(title="Ready to reboot DB.",
                                    message="Ready to reboot DB.\n"
                                    "Undo")

        if res == tkMessageBox.NO:
            return

        data_df = get_db_data()

        Vault.data = data_df
        self.data_table.updateModel(TableModel(data_df))
        self.data_table.redraw()
Beispiel #20
0
    def show_global_pattern(self):

        global_query = "select array_to_string(fixed,',') as Partition,array_to_string(variable,',') as Predictor,agg,"+\
        "round((lambda)::numeric(4,2),2) as Support,model from "+self.assigned_global_table+\
        " where array_to_string(array_sort(fixed||variable),',')='"+self.query_group_str+"';"
        # logger.debug(global_query)
        self.global_pattern_df = pd.read_sql(global_query, self.conn)
        # logger.debug(self.global_pattern_df.head())
        # logger.debug(list(self.global_pattern_df))

        pattern_model = TableModel(dataframe=self.global_pattern_df)
        self.global_pattern_table.updateModel(pattern_model)
        self.global_pattern_table.redraw()
 def __init__(self, passed_dataframe=TableModel.getSampleData(), parent=None):
     self.is_showing = True
     self.parent = parent
     tk.Frame.__init__(self)
     self.main = tk.Toplevel(parent)
     self.main.geometry('1000x400+200+100')
     self.main.title('My Trades Table')
     self.main.protocol('WM_DELETE_WINDOW', self.on_closing)
     f = tk.Frame(self.main)
     f.pack(fill=tk.BOTH, expand=1)
     df = passed_dataframe
     self.table = pt = Table(f, dataframe=df, showtoolbar=True, showstatusbar=True)
     pt.show()
     return
Beispiel #22
0
    def show_updated_output(self):

        self.low_outlier_text = Label(self.high_low_frame,
                                      text='Unusually\nLow: ',
                                      font=('Times New Roman bold', 10),
                                      bg='light yellow')
        self.low_outlier_text.grid(column=0, row=0)

        self.low_outlier_label = Label(self.high_low_frame,
                                       bg='#98df8a',
                                       height=2,
                                       width=2)
        self.low_outlier_label.grid(column=1, row=0)

        self.high_outlier_text = Label(self.high_low_frame,
                                       text='Unusually\nHigh: ',
                                       font=('Times New Roman bold', 10),
                                       bg='light yellow')
        self.high_outlier_text.grid(column=0, row=1)

        self.high_outlier_label = Label(self.high_low_frame,
                                        bg='#ff9896',
                                        height=2,
                                        width=2)
        self.high_outlier_label.grid(column=1, row=1)

        if (self.low_outlier_row_numbers):
            self.query_result_table.setRowColors(
                rows=self.low_outlier_row_numbers, clr='#ffffff', cols='all')
        if (self.high_outlier_row_numbers):
            self.query_result_table.setRowColors(
                rows=self.high_outlier_row_numbers, clr='#ffffff', cols='all')

        chosen_row, filtered_result_df = self.use_local_filter_output()
        low_outlier_rows, self.low_outlier_row_numbers, high_outlier_rows, self.high_outlier_row_numbers = self.get_outlier_frame(
            chosen_row, filtered_result_df)
        self.query_result_df = filtered_result_df
        model = TableModel(dataframe=filtered_result_df)
        self.query_result_table.updateModel(model)
        self.query_result_table.redraw()
        if (self.low_outlier_row_numbers):
            self.query_result_table.setRowColors(
                rows=self.low_outlier_row_numbers, clr='#98df8a', cols='all')
        if (self.high_outlier_row_numbers):
            self.query_result_table.setRowColors(
                rows=self.high_outlier_row_numbers, clr='#ff9896', cols='all')
Beispiel #23
0
    def show_local_pattern(self):

        local_query = "select array_to_string(fixed,',') as Partition,array_to_string(variable,',') as Predictor,"+\
        "array_to_string(fixed_value,',') as partition_values,agg,model,fixed,fixed_value,variable,"+\
        "theta,param,stats,dev_pos,dev_neg from "+self.assigned_local_table+\
        " where array_to_string(array_sort(fixed||variable),',')='"+self.query_group_str+"';"

        for n in self.local_pattern_table.multiplerowlist:
            self.chosen_local_pattern = self.global_pattern_table.model.df.iloc[
                int(n)]

        self.local_output_pattern_df = pd.read_sql(local_query, self.conn)

        local_shown = self.local_output_pattern_df[[
            'partition', 'partition_values', 'predictor', 'agg'
        ]]

        pattern_model = TableModel(local_shown)
        self.local_pattern_table.updateModel(pattern_model)
        self.local_pattern_table.redraw()
Beispiel #24
0
    def run_query(self):

        self.low_outlier_text.destroy()
        self.low_outlier_label.destroy()
        self.high_outlier_text.destroy()
        self.high_outlier_label.destroy()

        self.user_query, self.query_group_str, self.agg_function, self.user_agg, self.agg_name, self.cur_table_name = self.query_temp.get_query(
        )
        # logger.debug(self.user_query)
        self.handle_view ="\nDROP VIEW IF EXISTS user_query;"+\
        "\nCREATE VIEW user_query as "+ self.user_query
        # logger.debug(self.handle_view)
        try:
            self.cur.execute(self.handle_view)
            self.conn.commit()
        except:
            tkinter.messagebox.showinfo("Info",
                                        "Invalid Query, Please Doublecheck!")

        self.original_query_result_df = pd.read_sql(self.user_query, self.conn)
        self.query_result_df = self.original_query_result_df

        self.plot_data_convert_dict, self.query_data_convert_dict = self.db_info.get_db_data_type(
            self.cur_table_name)
        self.plot_data_convert_dict[self.agg_name] = 'numeric'
        self.query_data_convert_dict[self.agg_name] = 'float'

        self.assigned_global_table = 'pattern.{}_global'.format(
            self.cur_table_name)
        self.assigned_local_table = 'pattern.{}_local'.format(
            self.cur_table_name)

        model = TableModel(dataframe=self.original_query_result_df)
        self.query_result_table.updateModel(model)
        self.query_result_table.setRowColors(
            rows=self.high_outlier_row_numbers, clr='#ffffff', cols='all')
        self.query_result_table.setRowColors(rows=self.low_outlier_row_numbers,
                                             clr='#ffffff',
                                             cols='all')
        self.query_result_table.redraw()
 def __init__(self, parent, controller):
     from tkinter import ttk
     tk.Frame.__init__(self, parent)
     s=str("Month: "+m+" and Weather Condition: "+c+".")
     from pandastable import Table, TableModel
     lbl=tk.Label(self, text=s, font=("Arial Bold", 18))
     lbl.grid(row=0, column=1)
     f = Frame(self)
     f.grid(row=2, column=0, columnspan=3)
     df = TableModel.getSampleData()
     print(type(df))
     self.table = pt = Table(f, dataframe=df1,
     showtoolbar=True, showstatusbar=True)
     pt.show()
     btn122=tk.Button(self, text="Back", command=lambda : controller.show_frame(pageone))
     btn122.grid(row=0, column=0)
     btn122=tk.Button(self, text='Go to Home', command=lambda : controller.show_frame(startpage))
     btn122.grid(row=3, column=1)
    
     label=tk.Label(self, text=txt)
     label.grid(row=1, column=0, columnspan=4)
    def open(self):
        if self.view.column_mapping_dataframe is None:
            self.model = TableModel(dataframe=pd.read_excel(
                io=self.view.wb_filename,
                header=self.view.header_row - 1,
                sheet_name=self.view.ws_name_selection))

            self.mapper_dict = {}
            for column_name in self.model.df.columns.values.tolist():
                self.mapper_dict[column_name] = ColumnMapper(
                    master_frame=self,
                    paned_frame=self.mapping_paned_window,
                    col_name=column_name)
            for obj in self.mapper_dict.values():
                self.mapping_paned_window.add(obj, minsize=30, stretch="never")
        else:
            self.model = self.view.column_mapping_dataframe
        self.table.updateModel(self.model)
        self.table.statusbar.update()
        self.bind_all("<KP_8>", self.table.handle_arrow_keys)
        self.bind_all("<Return>", self.table.handle_arrow_keys)
        self.bind_all("<Tab>", self.table.handle_arrow_keys)
        self.grid()
Beispiel #27
0
    def import_csv(self):
        input_file = tkFileDialog.askopenfilename()
        if not input_file.strip():
            tkMessageBox.showerror(title="Error, Failed!", message="...")
            return

        try:
            import_df = pd.read_csv(input_file)
        except ParserError:
            tkMessageBox.showerror("Failed, Try again!.")

        if len(import_df) > 0:
            Vault.data.reset_index(level=["id_product"], inplace=True)
            table_df = Vault.data.append(import_df, ignore_index=False)
            table_df.set_index("id_product", inplace=True)

            Vault.data = table_df
            self.data_table.updateModel(TableModel(table_df))
            self.data_table.redraw()

            tkMessageBox.showinfo(title="Done",message="Pass")
        else:
            tkMessageBox.showinfo(title="Error, Failed!", message="...")
 def __update_table(self):
     """__update_table updates pandastable to display the actual dataframe"""
     self.__pdtable.updateModel(TableModel(self.__importer.dfx))
     self.__pdtable.redraw()
Beispiel #29
0
    def handle_question(self, direction):

        self.question_tuple = ''
        config = ExplConfig()
        config.conn = self.config.conn
        config.cur = self.config.cur
        config.query_table_name = self.cur_table_name
        eg = ExplanationGenerator(
            config, {
                'pattern_table': 'dev.{}'.format(self.cur_table_name),
                'query_result_table': self.cur_table_name
            })
        eg.initialize()
        col_name = [
            'Explanation_Tuple', "Score", 'From_Pattern', "Drill_Down_To",
            "Distance", "Outlierness", "Denominator", "relevent_model",
            "relevent_param", "refinement_model", "drill_param"
        ]
        exp_df = pd.DataFrame(columns=[
            "From_Pattern", "Drill_Down_To", "Score", "Distance",
            "Outlierness", "Denominator", "relevent_model", "relevent_param",
            "refinement_model", "drill_param"
        ])
        for n in self.query_result_table.multiplerowlist:

            self.question = self.query_result_table.model.df.iloc[[int(n)]]
            self.original_question = self.question.copy(deep=True)
            self.question.rename(columns={self.agg_name: self.user_agg},
                                 inplace=True)
            self.question_tuple = self.query_result_df.iloc[[int(n)]]
            # logger.debug(self.question)
            self.question['direction'] = direction
            self.question['lambda'] = 0.2
            question = self.question.iloc[0].to_dict()
            # logger.debug(question)
            elist = eg.do_explain_online(question)

            exp_list = []
            for e in elist:
                tuple_list = []
                # print(str(e.tuple_value))
                # print(str(e.tuple_value.keys()))
                # e_tuple_str = ','.join(map(str, e.tuple_value.values()))
                e_tuple_str = e.ordered_tuple_string()
                tuple_list.append(e_tuple_str)

                score = round(e.score, 2)
                tuple_list.append(score)

                if e.expl_type == 1:
                    local_pattern=(
                     '[' + ','.join(e.relevent_pattern[0]) +\
                     '=' + ','.join(list(map(str, e.relevent_pattern[1]))) +']:'+ \
                     ','.join(list(map(str, e.relevent_pattern[2])))+' \u2933 '+self.agg_name
                     )
                    relevent_model = e.relevent_pattern[4]
                    if e.relevent_pattern[4] == 'const':
                        relevent_param = str(
                            round(
                                float(e.relevent_pattern[6].split(',')[0][1:]),
                                2))
                    else:
                        # relevent_param = 'Intercept=' + str(e.relevent_pattern[7]['Intercept'])+', '+str(list(e.relevent_pattern[7])[1])+'='+str(round(e.relevent_pattern[7][list(e.relevent_pattern[7])[1]],2))
                        relevent_param = e.relevent_pattern[7]

                    drill_down_to = ','.join([
                        x for x in e.refinement_pattern[0]
                        if x not in e.relevent_pattern[0]
                    ])
                    refinement_model = e.refinement_pattern[4]
                    if e.refinement_pattern[4] == 'const':

                        drill_param = str(
                            round(
                                float(
                                    e.refinement_pattern[6].split(',')[0][1:]),
                                2))
                    else:
                        drill_param = e.refinement_pattern[7]
                else:
                    relevent_model = e.relevent_pattern[4]
                    local_pattern=(
                     '[' + ','.join(e.relevent_pattern[0]) +\
                     '=' + ','.join(list(map(str, e.relevent_pattern[1]))) +']:'+ \
                     ','.join(list(map(str, e.relevent_pattern[2])))+' \u2933 '+self.agg_name
                     )
                    if e.relevent_pattern[4] == 'const':
                        relevent_param = str(
                            round(
                                float(e.relevent_pattern[6].split(',')[0][1:]),
                                2))
                    else:
                        # relevent_param = 'Intercept=' + str(e.relevent_pattern[7]['Intercept'])+', '+str(list(e.relevent_pattern[7])[1])+'='+str(e.relevent_pattern[7][list(e.relevent_pattern[7])[1]])
                        relevent_param = e.relevent_pattern[7]

                    refinement_model = ''
                    drill_down_to = ''
                    drill_param = ''
                tuple_list.append(local_pattern)
                tuple_list.append(drill_down_to)
                distance = round(e.distance, 2)
                tuple_list.append(distance)
                outlierness = round(e.deviation, 2)
                tuple_list.append(outlierness)
                denominator = round(e.denominator, 2)
                tuple_list.append(denominator)
                tuple_list.append(relevent_model)
                tuple_list.append(relevent_param)
                tuple_list.append(refinement_model)
                tuple_list.append(drill_param)
                exp_list.append(tuple_list)

            df_exp = pd.DataFrame(exp_list, columns=col_name)
            exp_df = exp_df.append(df_exp, ignore_index=True)

        self.exp_df = exp_df[col_name]
        model = TableModel(dataframe=self.exp_df)
        self.exp_table.updateModel(model)
        self.exp_table.redraw()
Beispiel #30
0
 def test(self):
     path = 'test_batch'
     for i in range(20):
         df = TableModel.getSampleData()
         df.to_csv(os.path.join(path, 'test%s.csv' % str(i)))
     return