Spaces:
Runtime error
Runtime error
Update analytics.py
Browse files- analytics.py +5 -7
analytics.py
CHANGED
@@ -3,12 +3,10 @@ import pandas as pd
|
|
3 |
import numpy as np
|
4 |
import os
|
5 |
|
6 |
-
script_directory = os.path.dirname(os.path.abspath(__file__))
|
7 |
-
|
8 |
def write_to_csv_departments(time,teachingscore,teaching,courseContentscore,courseContent,
|
9 |
examinationscore,examination,labWorkscore,labWork,libraryFacilitiesscore,
|
10 |
libraryFacilities,extraCurricularscore,extraCurricular):
|
11 |
-
csv_file_path =
|
12 |
|
13 |
with open(csv_file_path, 'r') as f:
|
14 |
reader = csv.reader(f)
|
@@ -28,7 +26,7 @@ def write_to_csv_departments(time,teachingscore,teaching,courseContentscore,cour
|
|
28 |
|
29 |
def write_to_csv_teachers(teacher1,teacher1score,teacher2,teacher2score,teacher3,teacher3score,
|
30 |
teacher4,teacher4score,teacher5,teacher5score,teacher6,teacher6score):
|
31 |
-
csv_file_path =
|
32 |
with open(csv_file_path, 'r') as f:
|
33 |
reader = csv.reader(f)
|
34 |
for header in reader:
|
@@ -48,7 +46,7 @@ def write_to_csv_teachers(teacher1,teacher1score,teacher2,teacher2score,teacher3
|
|
48 |
|
49 |
|
50 |
def get_counts():
|
51 |
-
csv_file_path =
|
52 |
df = pd.read_csv(csv_file_path)
|
53 |
index = df.index
|
54 |
no_of_students = len(index)
|
@@ -102,13 +100,13 @@ def get_counts():
|
|
102 |
li
|
103 |
|
104 |
def get_tables():
|
105 |
-
csv_file_path =
|
106 |
df = pd.read_csv(csv_file_path)
|
107 |
df = df.tail(5)
|
108 |
return [df.to_html(classes='data')]
|
109 |
|
110 |
def get_titles():
|
111 |
-
csv_file_path =
|
112 |
df = pd.read_csv('dataset/database.csv')
|
113 |
return df.columns.values
|
114 |
|
|
|
3 |
import numpy as np
|
4 |
import os
|
5 |
|
|
|
|
|
6 |
def write_to_csv_departments(time,teachingscore,teaching,courseContentscore,courseContent,
|
7 |
examinationscore,examination,labWorkscore,labWork,libraryFacilitiesscore,
|
8 |
libraryFacilities,extraCurricularscore,extraCurricular):
|
9 |
+
csv_file_path = 'dataset/database.csv'
|
10 |
|
11 |
with open(csv_file_path, 'r') as f:
|
12 |
reader = csv.reader(f)
|
|
|
26 |
|
27 |
def write_to_csv_teachers(teacher1,teacher1score,teacher2,teacher2score,teacher3,teacher3score,
|
28 |
teacher4,teacher4score,teacher5,teacher5score,teacher6,teacher6score):
|
29 |
+
csv_file_path = 'dataset/teacherdb.csv'
|
30 |
with open(csv_file_path, 'r') as f:
|
31 |
reader = csv.reader(f)
|
32 |
for header in reader:
|
|
|
46 |
|
47 |
|
48 |
def get_counts():
|
49 |
+
csv_file_path = 'dataset/database.csv'
|
50 |
df = pd.read_csv(csv_file_path)
|
51 |
index = df.index
|
52 |
no_of_students = len(index)
|
|
|
100 |
li
|
101 |
|
102 |
def get_tables():
|
103 |
+
csv_file_path = 'dataset/database.csv'
|
104 |
df = pd.read_csv(csv_file_path)
|
105 |
df = df.tail(5)
|
106 |
return [df.to_html(classes='data')]
|
107 |
|
108 |
def get_titles():
|
109 |
+
csv_file_path = 'dataset/database.csv'
|
110 |
df = pd.read_csv('dataset/database.csv')
|
111 |
return df.columns.values
|
112 |
|