Description: Answers to Problem 6 answer sheet (MIE 304) Example command line usage: $ python problem_6.py --q1 True ''' import argparse import os from utils.load_data import load_csv from utils.viz_data import x_bar_any_chart_plot from utils.calc_stats import s_chart_values, x_bar_s_chart_values, chart_control_type # Globals Q6_DATA_FP = "../data/06_data.csv" DATA = load_csv(Q6_DATA_FP) # Command line arguments parser = argparse.ArgumentParser() parser.add_argument('--q5', help='Run question 5') args = parser.parse_args() if args.q5: sample_size = 3 # In each sample, there are 3 values # Calculate S-chart values # NOTE: Custom implementation for future questions will require changes to the category information to parse dataframe within the function S_VALS, S_BAR, S_UCL, S_LCL = s_chart_values(DATA, sample_size, 'Thickness') # Calculate X-bar chart values
Description: Answers to Problem 2 answer sheet (MIE 304) Example command line usage: $ python problem_2.py --q1 True ''' import argparse import os from utils.load_data import load_csv from utils.viz_data import stem_plot, histogram_plot, cumulative_frequency_plot, box_plot, time_series_plot from utils.calc_stats import mode_mean_median_calc, IQR, binom, geometric, hyper_geometric, poisson, normal # Globals Q2_DATA_FP = "../data/02_data.csv" DATA = load_csv(Q2_DATA_FP) # Command line arguments parser = argparse.ArgumentParser() parser.add_argument('--q1', help='Run question 1') parser.add_argument('--q2', help='Run question 2') parser.add_argument('--q3', help='Run question 3') parser.add_argument('--q4', help='Run question 4') parser.add_argument('--q5', help='Run question 5') parser.add_argument('--q6', help='Run question 6') parser.add_argument('--q7', help='Run question 7') parser.add_argument('--q8', help='Run question 8') parser.add_argument('--q9', help='Run question 9') parser.add_argument('--q10', help='Run question 10') parser.add_argument('--q11', help='Run question 11') parser.add_argument('--q12', help='Run question 12')
''' import argparse import os from utils.load_data import load_csv from utils.calc_stats import A2, D3, D4 import sys import pandas as pd import numpy as np import scipy.stats as stat import matplotlib matplotlib.use('TkAgg') # This is for Debian OS issues import matplotlib.pyplot as plt import math # Globals DATA_FP = "../data/12_data.csv" DATA = load_csv(DATA_FP) # Command line arguments parser = argparse.ArgumentParser() parser.add_argument('--q1', help='Run question 1') args = parser.parse_args() if args.q1: ''' This question addresses Q1 ''' print(DATA)
Owner: Mit Jothiravi (1002321258) Description: Answers to Problem 3 answer sheet (MIE 304) Example command line usage: $ python problem_3.py --q1 True ''' import argparse import os from utils.load_data import load_csv from utils.calc_stats import null_hypothesis_testing, type_2_beta # Globals Q3_DATA_FP = "../data/03_data.csv" DATA = load_csv(Q3_DATA_FP) # Command line arguments parser = argparse.ArgumentParser() parser.add_argument('--q1', help='Run question 1') parser.add_argument('--q2', help='Run question 2') parser.add_argument('--q3', help='Run question 3') parser.add_argument('--q4', help='Run question 4') args = parser.parse_args() if args.q1: null_hypothesis = 12.00 # Given in question null_hypothesis_testing(DATA, 'Net Contents (Oz)', null_hypothesis) if args.q2: given_population_mean = 12.00
import os from utils.load_data import load_csv import sys import pandas as pd import numpy as np import scipy.stats as stat import matplotlib matplotlib.use('TkAgg') # This is for Debian OS issues import matplotlib.pyplot as plt import math # Globals Q8_DATA_FP = "../data/08_data.csv" DATA = load_csv(Q8_DATA_FP) # Command line arguments parser = argparse.ArgumentParser() parser.add_argument('--q1', help='Run question 1') parser.add_argument('--q2', help='Run question 2') parser.add_argument('--q3', help='Run question 3') parser.add_argument('--q4', help='Run question 4') parser.add_argument('--q6', help='Run question 6') parser.add_argument('--q7', help='Run question 7') args = parser.parse_args() if args.q1: ''' Will address Q1 Problem 8 sheet
Description: Answers to Problem 5 answer sheet (MIE 304) Example command line usage: $ python problem_5.py --q1 True ''' import argparse import os from utils.load_data import load_csv from utils.viz_data import x_bar_any_chart_plot from utils.calc_stats import r_chart_values, x_bar_r_chart_values, chart_control_type # Globals Q5_DATA_FP = "../data/05_data.csv" DATA = load_csv(Q5_DATA_FP) # Command line arguments parser = argparse.ArgumentParser() parser.add_argument('--q1', help='Run question 1') parser.add_argument('--q2', help='Run question 2') parser.add_argument('--q3', help='Run question 3') parser.add_argument('--q4', help='Run question 4') args = parser.parse_args() if args.q1: sample_size = 4 # In each sample, there are 4 values # Calculate R-chart values # NOTE: Custom implementation for future questions will require changes to the ## parsing mechanism within r_chart_values function
subprocess.check_output(['2to3', '-w', '--no-diffs', file_name + '.py'], stderr=subprocess.PIPE) except (json.decoder.JSONDecodeError, simplejson.errors.JSONDecodeError) as e: print("Incorrect ipynb(json) format") print(e) continue except subprocess.CalledProcessError as e: error_msg = e.stderr.decode() print(error_msg) continue if not is_analyzable(file_name + '.py'): print("Unassociated codes are exist") continue refine_python_code(file_name + '.py') load_csv(file_name + '.py', repo_path) # tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix], trace=1, count=1) prev_pkg_name = None is_useless_repo = True while True: print("Start notebook: %s" % REPO_PATH + repo_path['repo'] + '/' + file_name + '.py') try: # Trace the python file ignore_dir = ":".join(sys.path[1:]) subprocess.check_output([PYTHON_BIN, '-m', 'trace', "--ignore-dir=" + ignore_dir, '--count', '-C', "cover/", file_name + '.py'], stderr=subprocess.PIPE)