-
Notifications
You must be signed in to change notification settings - Fork 0
/
PP_overall_values.py
82 lines (66 loc) · 2.31 KB
/
PP_overall_values.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Want to calculate overall PP(top10) values for inclusion in text
import pandas as pd
# Load data
fellows_bib = pd.read_excel(
"Data/SciLifeLab-fellows-20221212.xlsx",
sheet_name="publ_info",
engine="openpyxl",
)
infra_bib = pd.read_excel(
"Data/SciLifeLab-infrastructure-20221212.xlsx",
sheet_name="publ_info",
engine="openpyxl",
)
affiliates_bib = pd.read_excel(
"Data/SciLifeLab-affiliates-20221212.xlsx",
sheet_name="publ_info",
engine="openpyxl",
)
# Filter all dataframes to include only years of interest (for 2022 is 2017-20)
fell_scores = fellows_bib[
(fellows_bib["Publication_year"] == 2017)
| (fellows_bib["Publication_year"] == 2018)
| (fellows_bib["Publication_year"] == 2019)
| (fellows_bib["Publication_year"] == 2020)
]
inf_scores = infra_bib[
(infra_bib["Publication_year"] == 2017)
| (infra_bib["Publication_year"] == 2018)
| (infra_bib["Publication_year"] == 2019)
| (infra_bib["Publication_year"] == 2020)
]
aff_scores = affiliates_bib[
(affiliates_bib["Publication_year"] == 2017)
| (affiliates_bib["Publication_year"] == 2018)
| (affiliates_bib["Publication_year"] == 2019)
| (affiliates_bib["Publication_year"] == 2020)
]
# Filter for just the article types of interest
fell_filtered = fell_scores[
(fell_scores["Doc_type_code_rev"] == "RV")
| (fell_scores["Doc_type_code_rev"] == "AR")
| (fell_scores["Doc_type_code_rev"] == "PP")
]
inf_filtered = inf_scores[
(inf_scores["Doc_type_code_rev"] == "RV")
| (inf_scores["Doc_type_code_rev"] == "AR")
| (inf_scores["Doc_type_code_rev"] == "PP")
]
aff_filtered = aff_scores[
(aff_scores["Doc_type_code_rev"] == "RV")
| (aff_scores["Doc_type_code_rev"] == "AR")
| (aff_scores["Doc_type_code_rev"] == "PP")
]
aff_filtered.drop(
aff_filtered.index[aff_filtered["top10_scxwo"] == "None"], inplace=True
)
# Now get total PP values for the publications by each group
fell_filtered["top10_scxwo"] = fell_filtered["top10_scxwo"].astype(float)
avfells = fell_filtered["top10_scxwo"].mean()
print(avfells)
inf_filtered["top10_scxwo"] = inf_filtered["top10_scxwo"].astype(float)
avinf = inf_filtered["top10_scxwo"].mean()
# print(avinf)
aff_filtered["top10_scxwo"] = aff_filtered["top10_scxwo"].astype(float)
avaffs = aff_filtered["top10_scxwo"].mean()
# print(avaffs)