diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..59e9f428 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +benchmark_data.csv diff --git a/__pycache__/analysis.cpython-37.pyc b/__pycache__/analysis.cpython-37.pyc index f1dd7180..826be636 100644 Binary files a/__pycache__/analysis.cpython-37.pyc and b/__pycache__/analysis.cpython-37.pyc differ diff --git a/analysis.py b/analysis.py index 73562b49..13556dad 100644 --- a/analysis.py +++ b/analysis.py @@ -8,7 +8,7 @@ #setup: -__version__ = "1.0.3.006" +__version__ = "1.0.3.007" __author__ = ( "Arthur Lu , " @@ -48,6 +48,7 @@ import math import matplotlib import numbers import numpy as np +import random import scipy from sklearn import * #import statistics <-- statistics.py functions have been integrated into analysis.py as of v 1.0.3.002 @@ -584,6 +585,34 @@ def basic_analysis(filepath): #assumes that rows are the independent variable an return[row_b_stats, column_b_stats, row_histo] +def benchmark(x, y): + + start_g = time.time() + generate_data("benchmark_data.csv", x, y, -10, 10) + end_g = time.time() + + start_a = time.time() + basic_analysis("benchmark_data.csv") + end_a = time.time() + + return [(end_g - start_g), (end_a - start_a)] + +def generate_data(filename, x, y, low, high): + + file = open(filename, "w") + + for i in range (0, y, 1): + + temp = "" + + for j in range (0, x - 1, 1): + + temp = str(random.uniform(low, high)) + "," + temp + + temp = temp + str(random.uniform(low, high)) + file.write(temp + "\n") + + #statistics def below------------------------------------------------------------------------------------------------------------------------------------------------------ class StatisticsError(ValueError):