Exemplo n.º 1
0
def main():
    while True:
        TextUtils.print_menu(constant.MENU_SELECT_DATA_SET)
        selection = ExceptionUtils.select_int(
            constant.MENU_SELECT_DATA_SET_INPUT, 1, 3)
        if selection == 1:
            print(f"Opening CSV {constant.DEFAULT_DATA_SET_FILE}")
            data_frame = create_data_frame(
                constant.DEFAULT_DATA_SET_FILE, ",",
                constant.DEFAULT_DATA_SET_DATA_TYPES)
            if data_frame:
                use_data_frame(data_frame)
        elif selection == 2:
            path = input(constant.ENTER_PATH)
            delimiter = input(constant.ENTER_DELIMITER)
            print(f"Opening CSV {path}")
            data_frame = create_data_frame(path, delimiter, [])
            if data_frame:
                use_data_frame(data_frame)
        elif selection == 3:
            break
Exemplo n.º 2
0
def use_data_frame(data_frame):
    while True:
        TextUtils.print_menu(constant.MENU_USE_DATA_SET)
        selection = ExceptionUtils.select_int(constant.MENU_USE_DATA_SET_INPUT,
                                              1, 11)
        if selection == 1:
            TextUtils.print_dict(data_frame.data)
        elif selection == 2:
            data_frame.print_headings_with_type()
        elif selection == 3:
            data_frame.print_headings_with_type()
            column = get_valid_axis(constant.GET_COLUMN, data_frame)
            data_frame.print_deviation_calculations(column)
        elif selection == 4:
            data_frame.print_headings_with_type()
            column = get_valid_axis(constant.GET_COLUMN, data_frame)
            data_frame.plot_normal_distribution(column)
        elif selection == 5:
            data_frame.print_headings_with_type()
            column = get_valid_axis(constant.GET_COLUMN, data_frame)
            date = datetime.now().strftime(constant.DATE_FOTMAT)
            data_frame.export_normal_distribution(column, date)
        elif selection == 6:
            data_frame.export_all_normal_distribution()
        elif selection == 7:
            run_regression(data_frame)
            data_frame.print_linear_regression_output()
        elif selection == 8:
            run_regression(data_frame)
            date = datetime.now().strftime(constant.DATE_FOTMAT)
            data_frame.export_linear_regression_output(date)
        elif selection == 9:
            run_regression(data_frame)
            data_frame.plot_linear_regression_output()
        elif selection == 10:
            data_frame.export_linear_regression_output_all()
        elif selection == 11:
            break