-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCategory_and_levels.py
63 lines (57 loc) · 1.7 KB
/
Category_and_levels.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
55
56
57
58
59
60
61
62
63
import pandas as pd
df = pd.read_csv("Data_after_inter_annotator_agreement.csv")
resource_columns = [
"Dataset",
"Source Code",
"Open source frameworks or environment",
"Model architecture",
]
methodological_columns = [
"Software and Hardware Specification",
"Methods",
"Hyper-parameters",
]
statistical_columns = ["Averaging result", "Evaluation metrics"]
df["Resources Information"] = df[resource_columns].apply(
lambda row: "n" if "n" in row.values else "y", axis=1
)
df["Methodological Information"] = df[methodological_columns].apply(
lambda row: "n" if "n" in row.values else "y", axis=1
)
df["Statistical Information"] = df[statistical_columns].apply(
lambda row: "n" if "n" in row.values else "y", axis=1
)
df["Randomness Information"] = df["Randomness"]
df["Level 1"] = df["Resources Information"]
df["Level 2"] = df.apply(
lambda row: "y"
if row["Resources Information"] == "y" and row["Methodological Information"] == "y"
else "n",
axis=1,
)
df["Level 3"] = df.apply(
lambda row: "y"
if row["Resources Information"] == "y"
and row["Methodological Information"] == "y"
and row["Statistical Information"] == "y"
else "n",
axis=1,
)
df["Level 4"] = df.apply(
lambda row: "y"
if row["Resources Information"] == "y"
and row["Methodological Information"] == "y"
and row["Randomness Information"] == "y"
else "n",
axis=1,
)
df["Level 5"] = df.apply(
lambda row: "y"
if row["Resources Information"] == "y"
and row["Methodological Information"] == "y"
and row["Randomness Information"] == "y"
and row["Statistical Information"] == "y"
else "n",
axis=1,
)
df.to_csv("Final_data.csv", index=False)