-
Notifications
You must be signed in to change notification settings - Fork 1
/
RESET_DB.py
54 lines (33 loc) · 1.22 KB
/
RESET_DB.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#TO RESET THE DATABASE TO 0 ATTENDANCE
import pandas as pd
def reset():
list1=[]
data = pd.read_csv("C:/Anaconda codes/speaker reco/something new/for hack/attendance_database.csv")
names=data["NAMES"]
names=list(names)
usn=data["ROLL_NUMBER"]
usn=list(usn)
att=data["ATTENDANCE"]
att=list(att)
att1=list(att)
print(att)
rows=len(names)
att= [0] * len(names)
list1.append(att)
with open('registry.txt', 'a') as f:
for item in att1:
print(item)
f.write("%s" % item)
f.write("\n")
df = pd.read_csv("C:/Anaconda codes/speaker reco/something new/for hack/attendance_database.csv")
#rg=pd.read_csv("C:/Anaconda codes/speaker reco/something new/for hack/registry.csv")
#rg=pd.DataFrame[["nishant","padma","rajat","shreekar","shruthi"]]
df = df[['NAMES','ROLL_NUMBER','ATTENDANCE']]
d=df["ATTENDANCE"]
#rg.append(d)
for i in range(0,len(names)):
(df['ATTENDANCE'][i])=att[i]
print("\n RESET ")
print(df,"\n")
df.to_csv("C:/Anaconda codes/speaker reco/something new/for hack/attendance_database.csv")
reset()