-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFindS.py
More file actions
25 lines (21 loc) · 900 Bytes
/
FindS.py
File metadata and controls
25 lines (21 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import pandas as pd
import numpy as np
df=pd.read_csv("zoo.csv")
def gen(k):
for i in range(len(S[0])):
if S[df[df.columns[-1]][k]-1][i]=='phi':
S[df[df.columns[-1]][k]-1][i]=df[df.columns[i]][k]
elif S[df[df.columns[-1]][k]-1][i]=='?':
pass
elif S[df[df.columns[-1]][k]-1][i]==df[df.columns[i]][k]:
pass
else:
S[df[df.columns[-1]][k]-1][i]='?'
S=[['phi']*(df.shape[1]-1),['phi']*(df.shape[1]-1),['phi']*(df.shape[1]-1),['phi']*(df.shape[1]-1),['phi']*(df.shape[1]-1),['phi']*(df.shape[1]-1),['phi']*(df.shape[1]-1)]
for i in range(7):
print('Initial specific boundary S for category ',i+1,' = ',S[i])
for i in range(len(df)):
gen(i)
#print('S for category ',df[df.columns[-1]][i],'=',S[df[df.columns[-1]][i]-1])
for i in range(7):
print('Final specific boundary S for category ',i+1,' = ',S[i])