Encapsulate average_mkn
This commit is contained in:
parent
8d50ce6725
commit
8a556e999a
12
plot/main.py
12
plot/main.py
@ -7,8 +7,9 @@ nb_files = os.listdir(".." + os.sep + "export")
|
|||||||
|
|
||||||
size = len(nb_files)
|
size = len(nb_files)
|
||||||
|
|
||||||
# main array
|
|
||||||
averages = np.empty((size, 2))
|
def mean_mkn() -> np.ndarray:
|
||||||
|
averages_mkn = np.empty((size, 2))
|
||||||
nb = 0
|
nb = 0
|
||||||
for i in nb_files:
|
for i in nb_files:
|
||||||
data = pd.read_csv(".." + os.sep + "export" + os.sep + i, delimiter=';').to_numpy()
|
data = pd.read_csv(".." + os.sep + "export" + os.sep + i, delimiter=';').to_numpy()
|
||||||
@ -19,10 +20,13 @@ for i in nb_files:
|
|||||||
total = total + x
|
total = total + x
|
||||||
average = total / len(rb)
|
average = total / len(rb)
|
||||||
nb_users = i.split(".")[0]
|
nb_users = i.split(".")[0]
|
||||||
averages[nb, 0] = int(nb_users)
|
averages_mkn[nb, 0] = int(nb_users)
|
||||||
averages[nb, 1] = average
|
averages_mkn[nb, 1] = average
|
||||||
nb += 1
|
nb += 1
|
||||||
|
return averages_mkn
|
||||||
|
|
||||||
|
|
||||||
|
averages = mean_mkn()
|
||||||
# Data for plotting
|
# Data for plotting
|
||||||
averages.sort(axis=0)
|
averages.sort(axis=0)
|
||||||
x = averages[:, 0]
|
x = averages[:, 0]
|
||||||
|
Reference in New Issue
Block a user