Skip to content

Commit 4e34867

Browse files
authored
Merge pull request #18 from UW-Madison-DSI/features
Features
2 parents 383f44c + 280a985 commit 4e34867

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

docs/campus.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ df = survey_results
2929
3030
# Compute & glue (no visible output)
3131
valuable_pct = int(100 * df['QID24'].eq("Very valuable").mean())
32-
_ = glue("valuable_pct", valuable_pct, display=False) # prevents display
32+
glue("valuable_pct", valuable_pct, display=False) # prevents display
3333
3434
# Figure
3535
qid24_order = ["Very valuable","Some value","Neutral","No value"]
@@ -74,8 +74,8 @@ agree_options = {"Strongly agree", "Somewhat agree"}
7474
# ----- Figure 2: "There is a vibrant culture at UNI" by Respondent Type -----
7575
7676
77-
agree_vibrant = round(100 * df['QID23'].isin(["Strongly agree","Somewhat agree"]).mean(),2)
78-
_ = glue("agree_vibrant", agree_vibrant, display=False) # prevents display
77+
agree_vibrant = float(round(100 * df['QID23'].isin(["Strongly agree","Somewhat agree"]).mean(),2))
78+
glue("agree_vibrant", agree_vibrant, display=False) # prevents display
7979
8080
qid23_order = [
8181
"Strongly agree",
@@ -92,13 +92,13 @@ df_c2 = (
9292
.rename(columns={"QID4": "Respondent Type"})
9393
)
9494
95-
pct_makes_sense = round(
95+
pct_makes_sense = float(round(
9696
100 * df['QID23'].isin([
9797
"Strongly agree",
9898
"Somewhat agree",
9999
"Neither agree nor disagree"
100-
]).mean(), 2)
101-
_ = glue("pct_makes_sense", pct_makes_sense, display=False) # prevents display
100+
]).mean(), 2))
101+
glue("pct_makes_sense", pct_makes_sense, display=False) # prevents display
102102
103103
c2_df = (
104104
df_c2.groupby(["QID23", "Respondent Type"], observed=True, dropna=False)
@@ -127,7 +127,7 @@ In comparison, only **{glue:}`agree_vibrant`%** agreed that there is a vibrant o
127127
```{raw} html
128128
:file: _static/fig2.html
129129
```
130-
**{glue:}`pct_makes_sense`%** of respondents agreed that **it makes sense for the university to contribute to open source software that is vital to its educational and research enterprise**.
130+
**{glue:}`pct_makes_sense`%** of respondents agreed that ** "it makes sense for the university to contribute to open source software that is vital to its educational and research enterprise"**.
131131

132132
## Open Source Training On Campus
133133

@@ -139,7 +139,7 @@ In comparison, only **{glue:}`agree_vibrant`%** agreed that there is a vibrant o
139139
training_yes_pct = prop(df["QID25"], lambda s: s == "Yes")
140140
141141
received_training = int(100*df['QID25'].eq("Yes").astype(int).mean())
142-
_ = glue("received_training", received_training, display=False) # prevents display
142+
glue("received_training", received_training, display=False) # prevents display
143143
144144
145145
df_c3 = (
@@ -227,8 +227,8 @@ fig4.write_html('_static/fig4.html', full_html=False, include_plotlyjs='cdn')
227227
# Interest in more training (QID28) and OSPO workshops (QID29)
228228
more_training_pct = prop(df["QID28"], lambda s: s == "Yes")
229229
ospo_workshops_pct = prop(df["QID29"], lambda s: s == "Yes")
230-
_1 = glue("more_training_pct", more_training_pct, display=False) # prevents display
231-
_2 = glue("ospo_workshops_pct", ospo_workshops_pct, display=False) # prevents display
230+
glue("more_training_pct", more_training_pct, display=False) # prevents display
231+
glue("ospo_workshops_pct", ospo_workshops_pct, display=False) # prevents display
232232
233233
```
234234

docs/sample.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ df_ten = survey_results.copy()
229229
df_ten = df_ten[df_ten["QID4"].isin(["Faculty", "Staff"])].copy()
230230
231231
count_contributed_staff_fac = len(df_ten)
232-
pct_contributed_staff_fac = round(100*count_contributed_staff_fac/len(df),2)
232+
pct_contributed_staff_fac = float(round(100*count_contributed_staff_fac/len(df),2))
233233
234234
235235
glue("pct_contributed_staff_fac", pct_contributed_staff_fac, display=False)
@@ -313,7 +313,7 @@ df_maj["QID4"] = df_maj["QID4"].map(
313313
)
314314
315315
count_contributed_students = len(df_maj)
316-
pct_contributed_students = round(100*(count_contributed_students/len(df)),2)
316+
pct_contributed_students = float(round(100*(count_contributed_students/len(df)),2))
317317
glue("count_contributed_students", count_contributed_students, display=False)
318318
glue("pct_contributed_students", pct_contributed_students, display=False)
319319

0 commit comments

Comments
 (0)